PDA

View Full Version : CG Society Gallery Browser



Petr Schreiber
19-11-2011, 23:07
I like to visit the CG Society (http://www.cgsociety.org/) website from time to time, as it is community for 2D/3D artists and many tallented people post their work there.

There is one problem thought - when you open one of the galleries (http://forums.cgsociety.org/forumdisplay.php?f=121), it is organised in threads. So to see all images added since your last visit, you have to open each thread, wait till it loads, and it sometimes even timeouts...

To overcome this impractical browsing, I used INet module to download the forum page source code to memory without images (via INET_URLGetString), then I analyze it using string functions (GRAB$) for threads and its images, and create simplified view for me (creating custom HTML file on the fly) - just images and their titles (like in more classical gallery).

As the discussions around images on CG are sometimes interesting, I made the output in a way, that when you click the image, it takes you to the full version of the thread. Via context menu you can always get back.

It is not the most complex program ever made :p, but I think it can demonstrate how to use ThinBASIC for customizing the web browsing experience.

I attach the sources here, controls are simple, just click one of the buttons (3D / Stills for example), wait a bit for the load, and then you can enjoy the images without hectic thread opening.
The image count setting in the bottom part of the window allows you to setup how many images do you want to download.

The source code is organised to 3 files:

CGSociety_GalleryBrowser.tBasic - application itself
CGSociety_WebsiteHandling.tBasicU - specific routines to manage CG Society website forum
Control_NeatButton.tBasicU - specific routines for label-based flat button, which can "hold" string information


Petr

zak
20-11-2011, 07:06
this is surely a great utility, yes the site browsing are difficult, and this utility make it easier to look and to save the art pictures. i add this to your program the youtube files extractor here ... (http://www.thinbasic.com/community/showthread.php?11099-YouTube-Files) for my every day usage.
thanks

ErosOlmi
20-11-2011, 09:34
What a great tool Petr!
I think many CG Society (http://www.cgsociety.org/) users will be happy to have such a tool.

Thanks a lot.

matthew
21-11-2011, 01:55
Nice program Petr, it's interesting to see how information on web pages can be displayed in different ways. A few years ago I saw a similar type of program here (http://kazimirmajorinc.blogspot.com/2009/02/more-on-usenet-posting-frequency.html) written in Lisp which reads from a webpage containing information from Usenet newsgroups & then displays it as a chart.

Petr Schreiber
21-11-2011, 09:56
Nice to see such a useful LISP code, at university we just practised recursion on simple model cases.

The website data extraction can become very addictive :)


Petr