Sign in to follow this  
Followers 0
Achilles

Daily Comics - 5x faster loading!

118 posts in this topic

#1 ·  Posted (edited)

Now includes:

  • Achewood (every few days, not daily)
  • Arlon and Janis
  • Breakfast Cereal
  • Calvin and Hobbes
  • Dilbert
  • Doonesbury
  • Explosm
  • Garfield
  • Get Fuzzy
  • Monty
  • Peanuts
  • Rose is Rose
  • Xkcd (every few days, not daily) Thanks theguy1000

I rewrote this to be much faster. Instead of just finding one at a time in a for loop sort of fashion, this new script runs a bit of code separately for each comic at the same time, each of those then write its link to a text file. The main program just sits there and waits for all the text files to come in and once they are it's done. I'm getting all the comic links in about 12 seconds, whereas before it could be up to a minute or so.

To add your comics simply create your own <comic name>.au3 file in the folder where all the others are. All that file does is write the link to a file (<comic name>.txt) which is read by the main script. No modifications are needed to the Daily Comics.au3 file.

I included the old version just so you can see the difference.

Download here: Daily Comics.zip

Edited by Achilles

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey!! Sweet Script! I will use that every day.. Thank You

Would be cool to have a config where you could add your own comics to download.

edit: New thought after hitting submit.. LOL

Edited by gesller

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

New Version

Changes

  • Sunday comics are now supported
  • Images are put in at their exact size, not squished to fit a standard
  • Dilbert comic sometimes malfunctions, I changed it so that it waits ten seconds for it to work before going on
Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

An option of having a "save as" function button to save comics you liked would be fantastic. I will see if I can work on one if I get time.


CheersGrant

Share this post


Link to post
Share on other sites

Very nice.. something like this is useful to me. Ill always use it in the mornings when I get to work. Peanuts and Denis the minis would be a great addition :)


www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Very interesting script! Shouldn't this theoretically be able to do the same thing with regular webcomics (such as XKCD)? I would be interested in having such a functionality added. I would be willing to try to work out additional code to include such functionality myself, provided I have your permission and blessing.

This reminds me that I was looking into creating a Vista Gadet to do something similar to this very task. :)

By the way, could you put a link pointing to the location of the appropriate library?

Edited by GreNME

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Very interesting script! Shouldn't this theoretically be able to do the same thing with regular webcomics (such as XKCD)? I would be interested in having such a functionality added. I would be willing to try to work out additional code to include such functionality myself, provided I have your permission and blessing.

This reminds me that I was looking into creating a Vista Gadet to do something similar to this very task. :)

By the way, could you put a link pointing to the location of the appropriate library?

Feel free to work on it. I pretty much just combined the work of other people into a nice simple tabbed GUI. I really don't know where I got the version of AutoItLib that I use but I'll look for it.

@gw_1996

"An option of having a "save as" function button to save comics you liked would be fantastic. I will see if I can work on one if I get time."

I'll try that, it should be easy.

@Toady

I'll look into those. I planned this thing (sort of...) to be an expanding thing.

Unfortunately I'm at school right now (go study halls!) and we can't install anything so I'm left with no AutoIt...

EDIT: If you know of a homepage with cartoons let me know! And if you have time you could tell me the way they format their picture image.

For example calvin and hobbes is something like this: 20070911.jpg... and it obviously goes year month day.

Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

EDIT: If you know of a homepage with cartoons let me know! And if you have time you could tell me the way they format their picture image.

I'd love to see Achewood. (Note that Achewood is often very rude and crass. View at your own peril)

The URL for the daily comic is in this format. http://achewood.com/comic.php?date=09132007 But I'm not sure of the actual image URL format. The image is a .gif, but I don't know enough about PHP to know how to derive the actual image address.

Sometimes the comic is not updated daily. There are often two to three day gaps in comics.

If you would prefer not to add that one due to content, how about Penny Arcade?

http://www.penny-arcade.com/images/2007/20070912.jpg

Share this post


Link to post
Share on other sites

Hi.

I had a bit of a glitch where I couldnt view some of the gifs and the gifs were 0 bytes, looking at the code I realised that because I am in a different timezone, my date was a day in front therefore the gifs I was trying to download didnt exist yet. I changed the date to be yesterdays date by changing @MDAY to @MDAY-1 and I get the comics :) Might be a day out but it works for the time being. I will work on code to check for gif and if not exist change date to yesterday code and post when I get a chance to play a bit more.

Cheers.


CheersGrant

Share this post


Link to post
Share on other sites

+>19:34:52 Starting AutoIt3Wrapper v.1.9.2

C:\AutoIt3\test.au3 (49) : ==> Unknown function name.:

$calvinHobbes = _GDIP_Image($downloadLocation & 'CalvinAndHobbes.gif')

$calvinHobbes = ^ ERROR


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Hi.

I had same issue, all you need to do if follow the instructions.

"If you have errors try to switch the comment lines with the ones above them."

Rem out the _GDIP_Image lines and unrem the _GDIP_ImageLoadFromFile lines :)

;$calvinHobbes = _GDIP_Image($downloadLocation & 'CalvinAndHobbes.gif')

$calvinHobbes = _GDIP_ImageLoadFromFile($downloadLocation & 'CalvinAndHobbes.gif')


CheersGrant

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

lol sorry. Works now!

Here's another comic to add :)

http://www.ctrlaltdel-online.com/comic.php

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Does anyone have a version of AutoItLib besides me that loads images with the line "_GDIP_Image()"???

I changed (or will as soon as I post this) the original code to the way that seems more common to make life simpler.


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Where is the download for this?

I tried just using the code in the first post but it failed because I don't have #include <A3LGDIPlus.au3>

I don't know my way around the board very well. I did a search and looked in downloads, but didn't find anything.

Thanks

Share this post


Link to post
Share on other sites

Would it be possible to post a quick "How to add x comic"? I know the script isn't very long, but it would be nice if a noob such as myself could take the script and easily add another comic. Also is it possible to have the program automatically download the new comic everyday? I read RealLife Comics and have saved every one he has ever made, but obviously it is a lot of work and would be cool if a program did it for me. Not asking you to make it just wondering if it is possible and if there is something out there that does that.

Share this post


Link to post
Share on other sites

Where is the download for this?

I tried just using the code in the first post but it failed because I don't have #include <A3LGDIPlus.au3>

I don't know my way around the board very well. I did a search and looked in downloads, but didn't find anything.

Thanks

http://www.autoitscript.com/forum/index.php?showtopic=33677

Would it be possible to post a quick "How to add x comic"? I know the script isn't very long, but it would be nice if a noob such as myself could take the script and easily add another comic. Also is it possible to have the program automatically download the new comic everyday? I read RealLife Comics and have saved every one he has ever made, but obviously it is a lot of work and would be cool if a program did it for me. Not asking you to make it just wondering if it is possible and if there is something out there that does that.

The second suggestion you have would be pretty easy. Instead of deleting the pictures when the script exists just have them moved to where you want (and probably change the file name to so that it includes the date).

The first part is a bit harder because not all websites allow you to download the daily comics the same way (as I discovered while trying to add a few more options). If you have a specific comic I could try looking at it but I am by no means an expert in stuff like this.


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Are you going to put in Explosm comics?

Share this post


Link to post
Share on other sites

Heres my script for explosm comics.

this gets the link to the page from the the rss, then parses the image name from the page.

#include <INet.au3>
#include <Array.au3>
#include <String.au3>

$RSS = "http://feeds.feedburner.com/Explosm"
$RSSSource = _INetGetSource($RSS)
$Items = StringRegExp($RSSSource, "(?i)(?s)<item>.*?</item>",3)
$Count = UBound($Items)
Dim $Date[$Count], $Link[$Count], $Category[$Count]
For $i = 0 to $Count-1
$Dummy = _StringBetween($Items[$i], "<title>", "</title>")
$Date[$i] = $Dummy[0]
$Dummy = _StringBetween($Items[$i], "<link>", "</link>")
$Link[$i] = $Dummy[0]
$Dummy = _StringBetween($Items[$i], "<category>", "</category>")
$Category[$i] = $Dummy[0]
Next
$Start = 0
Do
If Not $Category[$Start]="Comics" then $Start+=1
Until $Category[$Start]="Comics" or $start >= $Count
$ItemNum= $Start
$PageSource = _INetGetSource($Link[$ItemNum])
$sourcelines = StringSplit($PageSource, @CRLF)
$ImageLink = _StringBetween($sourcelines[98], 'src="', '" border=0')
_ArrayDisplay($ImageLink)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0