It is currently Tue Jul 02, 2024 10:29 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 5:20 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Just an idea:

it could be interesting to have (it not yet available, IDK) an option to ask for getting the list of all topics in order of views received.

_________________
"Where am I ?"


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 9:41 am  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
I don't think there is a way right now on gc. it's like ancient phpbb I think.
So with the help of chatGPT I thought I would share a snapshot taken minutes ago here:
Active Topics listed by Decending Views Snapshot Jan 12, 2024

If you're interested in running the snapshot again at a later time. here's the python code (It takes about 7 minutes to run with 744 pages of pages which you can change number of pages and stuff in the loop)
I named it "gc.py"
import requests
from bs4 import BeautifulSoup

def get_page_source(url):
    response = requests.get(url)
    if response.status_code == 200:
        return response.text
    else:
        print(f"Failed to retrieve page. Status code: {response.status_code}")
        return None

def parse_table_rows(html_content):
    soup = BeautifulSoup(html_content, 'html.parser')
    table = soup.find_all('table', {'class': 'tablebg'})

    if len(table) > 1:  # Check if there is a second table with the class 'tablebg'
        second_table = table[1]
        rows = second_table.find_all('tr')

        data_array = []
        for row in rows[1:25]:  # Skip the first row as headers
            #print (str(row))
            columns = row.find_all(['td', 'th'])
            row_data = [column.get_text(strip=True) for column in columns]

            # Check if the third column is a link
            if len(columns)>=3:
                link_td = columns[2]
                link = link_td.find('a')
                if link:
                    href_value = link.get('href')
                    row_data.append(href_value)
                data_array.append(row_data)   
           
        return data_array

    else:
        print("Second table not found.")
        return None
    #print (html_content)
    # table = soup.find('table', {'class': 'tablebg'})
   
    # if table:
    #     rows = table.find_all('tr')
    #     for row in rows:
    #         columns = row.find_all(['td', 'th'])
    #         for column in columns:
    #             print(column.get_text(strip=True), end='\t')
    #         print()

if __name__ == "__main__":
    arrs = []
    for p in range(0,745):
        url = "http://gimpchat.com/search.php?st=0&sk=t&sd=d&sr=topics&search_id=active_topics&start=" + str(p*25)
        page_source = get_page_source(url)
        if page_source:
            arr = parse_table_rows(page_source)
            arrs = arrs + arr
            # for i in range(0,len(arr)):
            #     print ("<a href='" + str(arr[7])+ "'>" + str(arr[2]))

    sorted_array = sorted(arrs, key=lambda x: - int(x[5]))
    arr = sorted_array
    print ("<table><tr><td>No.</td><td>Topic</td><td>Author</td><td>Views</td></tr>")
    for i in range(0,len(arr)):
        row = arr[i]
        try:
            print ("<tr><td>"+str(i+1)+"</td><td><a href='http://gimpchat.com/" + str(row[7])+ "'>" + str(row[2]) + "</a></td><td>"+str(row[3])+"</td><td>"+str(row[5])+"</td></tr>")
        except UnicodeEncodeError as e:
            continue     


And I run it with the below command to output it to test1.html which can then be opened with browser
python gc.py > test1.html

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 9:58 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Wow.
Is it possible to extend the .py capability in order to do the list by topic groups?
like:
- Gimp Art
- Gimp Scripts and Plug-ins
- etc
to get a shorter list?

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 10:04 am  (#4) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
I'll see what I can do. :D

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 10:07 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Aug 08, 2016
Posts: 2061
Location: East Midlands of England
If I remember right Tim did some really interesting stuff in a similar way back over on GimpLearn for viewing custom fonts - but of course that was with recent web technology. But very useful.

_________________
Image

"Let no one steal your dreams."
Paul Cookson


Latest plug-in update: Paragrapher v.1.4
Custom Font Links
Tools
Character Paths
White Bases


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 10:09 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
If I download it as .pdf I get it but truncated horizontally; what can I set while saving to reduce maybe the characters dimension?

well, it can be saved as html, but if it could be produced with a bit smaller character size I think that also in pdf would be readable completely.

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:18 am  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
what are you trying to do as pdf? my snapshot?

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:28 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Yes

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:37 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Once downloaded as .pdf, you can see pages large as this one (only a small amount of the right part is lost)
Attachment:
OnePage of pdf.PNG
OnePage of pdf.PNG [ 139.2 KiB | Viewed 592 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:39 am  (#10) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
it fits fine if you choose "Print" then as PDF instead of saving as PDF
I can't attach it because it's bigger than 6MiB

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:40 am  (#11) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
here's snapshot broken down into their groups.
It's too large to be clickable link but it's there so you can text search by GROUPNAME:followed by groupname with no prepended space.
https://tinmantaken.blogspot.com/2024/0 ... roups.html

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:45 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
trandoductin wrote:
it fits fine if you choose "Print" then as PDF instead of saving as PDF
I can't attach it because it's bigger than 6MiB

it's what I did, just repeated and it fits as shown (losing part of the right side

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:51 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
The same happens with the new snapshop, maybe you created it with a width larger than 132?

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 11:57 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Also, the search seems not to work, it indicates the search entered on top but the detail is not


Attachments:
Search not done (only the top line is reporting the search).PNG
Search not done (only the top line is reporting the search).PNG [ 531.13 KiB | Viewed 587 times ]

_________________
"Where am I ?"
Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 12:01 pm  (#15) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
I don't know why Print as PDF not working for you. it fits on mine breaking the long lines into multiple lines maybe because it works better if you open the HTML as webpage then Print as PDF from the source rather than my page on the blog.

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 12:16 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
So, I can only browse the .html to read.
OK.
Thanks a lot in any case.

_________________
"Where am I ?"


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 1:27 pm  (#17) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
How can I upload a file larger than 6Mib to share? like pdf

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 1:33 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
It already there?

Attachment:
PerViews.png
PerViews.png [ 17.48 KiB | Viewed 574 times ]

_________________
Image


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 1:40 pm  (#19) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
What? It's already there? stupid me.

_________________
TinT


Top
 Post subject: Re: Proposal: a "View Topics in order of views"
PostPosted: Fri Jan 12, 2024 1:41 pm  (#20) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
How are you seeing that selection I don't see it for active topics.

_________________
TinT


Top
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Airbrush not applying in the right order?

2

No new posts Attachment(s) view a path when it is imported

12

No new posts Attachment(s) How to add new view rotation options?

13

No new posts Gimp 2.10.36: Menu - View - Display Filters - Clip : bug

0



* Login  



Powered by phpBB3 © phpBB Group