Jump to content

Daily Comics - 5x faster loading!


Achilles
 Share

Recommended Posts

Nice program, its really neat and well coded. A lot of cool comics. :D

Thanks!

Oooh, wait:

You should add an option by the comic image to save it!

That would be pretty easy to do... but would anyone ever use it? Why would you want to save a comic strip when they're always online?
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Replies 117
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I added a few of my own in case anyone wants them.

Great script. Great way to view all my daily comics at once. If anyone knows where I can find Zits and Foxtrot it'd help for getting through the day. Thanks.

Arlo and Janis, Rose is Rose, and Monty:

Func _GetMontyLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/monty/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/monty/archive/images/monty') > 0 then
            $temp = _StringBetween($array[$i], 'images/monty', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/monty/archive/images/monty' & $temp[0]
                $ret[1] = 'monty' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc


Func _GetroseisroseLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/roseisrose/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/roseisrose/archive/images/roseisrose') > 0 then
            $temp = _StringBetween($array[$i], 'images/roseisrose', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/roseisrose/archive/images/roseisrose' & $temp[0]
                $ret[1] = 'roseisrose' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc


Func _GetarlonjanisLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/arlonjanis/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/arlonjanis/archive/images/arlonjanis') > 0 then
            $temp = _StringBetween($array[$i], 'images/arlonjanis', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/arlonjanis/archive/images/arlonjanis' & $temp[0]
                $ret[1] = 'arlonjanis' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc

-- If the apocalypse comes... beep me.

Link to comment
Share on other sites

With the latest version (using the IE version) I get an error when trying to view the last comic in the list.

It says:

Line 89 (path to script):

GuiCtrlSetTip($ieObject, $temp[2])

GuiCtrlSetTip($ieObject, ^ERROR

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.

Link to comment
Share on other sites

Good job :D

For whom it concerns: just read on the german heise news ticker that the dilbert site will be cleaned from unnessecary garbage - and theres a new official link to see the comic of the day without flash:

http://www.dilbert.com/fast

But the comics are not bigger or better than the ones on the RSS feed :D

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

Link to comment
Share on other sites

Good job :D

For whom it concerns: just read on the german heise news ticker that the dilbert site will be cleaned from unnessecary garbage - and theres a new official link to see the comic of the day without flash:

http://www.dilbert.com/fast

But the comics are not bigger or better than the ones on the RSS feed :D

The comic links actually are the same. Some time I might check both websites to see which one I can get the link from faster... Though most people won't care, but some, like me, suffer from slow internet connection.
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 4 weeks later...

I haven't checked the comics for a week or so, so I don't know how long it's been doing this. When you attempt to view Breakfast Cereal in the IE version, you get the message "PAGE NOT FOUND JERK!!" When using the other version, you don't see the message but get a blank window.

Link to comment
Share on other sites

Thanks!

That would be pretty easy to do... but would anyone ever use it? Why would you want to save a comic strip when they're always online?

...so you could e-mail it to someone you thought would enjoy it?

...so you could print it and hang it on your wall at the office?

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

I haven't checked the comics for a week or so, so I don't know how long it's been doing this. When you attempt to view Breakfast Cereal in the IE version, you get the message "PAGE NOT FOUND JERK!!" When using the other version, you don't see the message but get a blank window.

It's been doing that off on on for awhile... I'll try modifying the code so that it works.

@james3mg: Alright, I'll add that in sometime soon.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 1 month later...

I haven't checked the comics for a week or so, so I don't know how long it's been doing this. When you attempt to view Breakfast Cereal in the IE version, you get the message "PAGE NOT FOUND JERK!!" When using the other version, you don't see the message but get a blank window.

That is now fixed (at least for today). But if it doesn't work in the future I'll be more prompt in fixing it, I just moved back to the states so I my life was chaos for a couple weeks.

I'll get onto saving the images soon...

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Updated

You can now save your comics in both the IE version as well as the normal version.

The normal version will no longer display pictures that are greater than the desktop height. Please note that even though pictures are not displayed they can still be saved. So if you have a comic that is "Too large to display" just save it and then view it from wherever you saved it.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 2 months later...

Hi all,

I wanted to bring back this great thread with some new comics and some fixed links. Also I add a function where it will email you all the comics as well as letting you view them on the computer. I just schedule this program to run every morning before I leave for work and then I can read the comics on my phone's email. I personally use mail.exe, but you can use the SMTP mailer code as well. Just change the var $bSendEmail to False if you don't want email. This might not have all the latest enhancements from before so just incorporate those features with this code. (Also I don't use all the comics in the list, so you can add your own). For any GoComics.com comics you can copy the Adam comic and just replace the website name with whichever comic you want.

Not sure if I posted this in a good format, so let me know how to fix it (how do I make the code in a scroll window).

Thanks again to Achilles for developing this script, this is one of my favorite and most used.

Enjoy.

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <INet.au3>
#include <Array.au3>
#include <String.au3>
#include <Misc.au3>
#include<ProgressConstants.au3>
#include<GuiListBox.au3>
#include<IE.au3>
#Include <File.au3>

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.6.0
 Author: Piano_Man
    Helped by...
        Marc - I modified his code for getting Dilbert comics
        i542 + JamesB - I used their code for the Garfield link
        PaulIA - For his great AutoItLib (it's built into AutoIt now)
        Paulie - Helped me with the Explosm comic
        theguy1000 - Helped me with the xkcd comic and getting the Explosm link
       
 Script Function:
    This script downloads comics from Breakfast Ceareal, Calvin and Hobbes, 
    Dilbert, Doonesbury, Explosm, Garfield, Peanuts and xkcd and shows them
    in a GUI that has tabs for each cartoon.

#ce ----------------------------------------------------------------------------

_Singleton('DailyComics.au3')

Opt('GUIOnEventMode', 1)
Opt('GUICloseOnESC', 1)

Global Const $NUM_OF_PICS = 15
Global Const $NAMES[$NUM_OF_PICS] = ['For Better Or For Worse','Stone Soup', 'Adam','BreakfastCereal', 'Calvin and Hobbes', 'Dilbert', 'Explosm', 'Garfield', 'Get Fuzzy', 'Peanuts', 'xkcd', 'Monty', 'arlonjanis', 'roseisrose', 'Zits']
Global $comics[$NUM_OF_PICS],$comicFiles
Global $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl, $oMyRet[2], $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$bSendEmail = True

If $bSendEmail Then
    $comicFiles = ""
    If FileExists("C:\Comics") = 0 Then
        DirCreate("C:\Comics")
    EndIf

    FileDelete("C:\Comics\*.*")
EndIf


GUICreate('Daily Comics', 950, 615)
    GuiSetOnEvent($GUI_EVENT_CLOSE, '_Exit')

$label = GuiCtrlCreateLabel('Gathering image links...', 200, 150, 500, 30) 
$progress = GuiCtrlCreateProgress(200, 175, 500, 30, $PBS_SMOOTH)
GUISetState()

For $indexToGet = 0 to $NUM_OF_PICS - 1
    $temp = Call('_Get' & StringStripWS($NAMES[$indexToGet], 8) & 'Link')
    If IsArray($temp) then
        $comics[$indexToGet] = $temp[0]
    Else
        $comics[$indexToGet] = "http://www.bloodsoaked.com/404.jpg"
    EndIf
    
    GuiCtrlSetData($progress, ($indexToGet + 1) / $NUM_OF_PICS * 100)
Next

GuiCtrlDelete($progress)
GuiCtrlDelete($label)

GUICtrlCreateLabel('Select a comic', 5, 5, 120, 17)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$list = GUICtrlCreateList('', 5, 30, 200, 385)
    GUICtrlSetOnEvent(-1, '_Redirect')
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

$oIE = _IECreateEmbedded() 
$ieObject = GUICtrlCreateObj($oIE, 210, 5, 733, 570)

For $i = 0 to $NUM_OF_PICS - 1
    _GuiCtrlListBox_AddString($list, $NAMES[$i])
Next

If $bSendEmail Then

    _SaveFiles()
;$Send = _INetSmtpMailCom("smtp.gmail.com", "yourgmailaccount@gmail.com", "yourgmailaccount@gmail.com", "yourgmailaccount@gmail.com", "Daily Comics", "Daily Comics:", $comicFiles, "", "", "yourgmailaccount@gmail.com", "password", 465, 1)
    $command = 'mail.exe -s "Daily Comics ' & '" -f ' & "C:\comics.txt" & ' -a ' & $comicFiles & " yourgmailaccount@gmail.com"
    Run($command,@ScriptDir)

EndIf


While 1
    Sleep(500)
WEnd

Func _Redirect() 
    $sel = _GuiCtrlListBox_GetCurSel($list)
    $selText = _GuiCtrlLIstBox_GetText($list, $sel)
    
    For $i = 0 to $NUM_OF_PICS - 1
        If $selText = $NAMES[$i] then 
            $grab = $i 
            ExitLoop 
        EndIf 
    Next 
    
    _IENavigate($oIE, $comics[$grab])
    
EndFunc


Func _SaveFiles() 
    $sel = _GuiCtrlListBox_GetCurSel($list)
    $selText = _GuiCtrlLIstBox_GetText($list, $sel)
    
    For $i = 0 to $NUM_OF_PICS - 1

    
    InetGet( $comics[$i], 'C:\Comics\' & $NAMES[$i] & '.gif')
    If $comicFiles <> "" Then
        $comicFiles &= "," & '"' & 'C:\Comics\' & $NAMES[$i] & '.gif' & '"'
    Else
        $comicFiles &= '"' & 'C:\Comics\' & $NAMES[$i] & '.gif' & '"'
    EndIf
    
Next
    
EndFunc


Func _Exit()
    GuiDelete()
    
    Exit
EndFunc


Func _GetAdamLink()
;can use this format for any GoComics strip
    
    Local $ret[2] = ['', '']
    Local $gotHere = False
    $source = _InetGetSource('http://gocomics.com/adamathome')
    
    $array = StringSplit($source, @CRLF)
    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], 'http://picayune.uclick.com/comics') > 0 then
                $temp = _StringBetween($array[$i], 'http://picayune.uclick.com/comics', '"') 
                
                If IsArray($temp) then 
                    $temp2 = StringSplit($temp[0],"/")
                    $tempVar = 'http://picayune.uclick.com/comics'
                    For $j = 1 to $temp2[0]
                        
                        If $temp2[$j] <> "" Then
                            $tempVar &= "/" & $temp2[$j]
                        EndIf
                    Next

                    $ret[0] = $tempVar
                    $ret[1] = $tempVar
                    Return $ret
                EndIf
        
            
        EndIf 
    Next



EndFunc

Func _GetStoneSoupLink()

    Local $ret[2] = ['', '']
    Local $gotHere = False
    $source = _InetGetSource('http://gocomics.com/stonesoup')
    
    $array = StringSplit($source, @CRLF)
    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], 'http://picayune.uclick.com/comics') > 0 then
                $temp = _StringBetween($array[$i], 'http://picayune.uclick.com/comics', '"') 
                
                If IsArray($temp) then 
                    $temp2 = StringSplit($temp[0],"/")
                    $tempVar = 'http://picayune.uclick.com/comics'
                    For $j = 1 to $temp2[0]
                        
                        If $temp2[$j] <> "" Then
                            $tempVar &= "/" & $temp2[$j]
                        EndIf
                    Next

                    $ret[0] = $tempVar
                    $ret[1] = $tempVar
                    Return $ret
                EndIf
        
            
        EndIf 
    Next



EndFunc

Func _GetForBetterOrForWorseLink()

    Local $ret[2] = ['', '']
    Local $gotHere = False
    $source = _InetGetSource('http://gocomics.com/forbetterorforworse')

    $array = StringSplit($source, @CRLF)
    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], 'http://picayune.uclick.com/comics') > 0 then
                $temp = _StringBetween($array[$i], 'http://picayune.uclick.com/comics', '"') 
                
                If IsArray($temp) then 
                    $temp2 = StringSplit($temp[0],"/")
                    $tempVar = 'http://picayune.uclick.com/comics'
                    For $j = 1 to $temp2[0]
                        
                        If $temp2[$j] <> "" Then
                            $tempVar &= "/" & $temp2[$j]
                        EndIf
                    Next

                    $ret[0] = $tempVar
                    $ret[1] = $tempVar
                    Return $ret
                EndIf
        
            
        EndIf 
    Next



EndFunc



Func _GetZitsLink()
    Local $ret[2] = ['', '']
    $RSS = "http://www.arcamax.com/zits/channelfeed"
    $RSSSource = _INetGetSource($RSS)
    $Items = StringRegExp($RSSSource, "(?i)(?s)<item>.*?</item>", 3)
    $Count = UBound($Items)
    $temp = $Items[0]
    $array2 = StringSplit($temp, @CRLF)
    $temp2 = $array2[4]
    $siteCurrent = StringReplace($temp2,'<link>',"")
    $siteCurrent = StringReplace($siteCurrent,'</link>',"")
    $siteCurrent = StringStripWS($siteCurrent,8)
    
    
    $source = _InetGetSource($siteCurrent)
    
    $array = StringSplit($source, @CRLF)
    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<a href="http://www.arcamax.com/cgi-bin/news/pic/') > 0 then
                $temp = _StringBetween($array[$i], '<a href="http://www.arcamax.com/cgi-bin/news/pic/', '" target="_blank"') 
                $ret[0] = "http://www.arcamax.com/pic/" & $temp[0]
                $ret[1] = "http://www.arcamax.com/pic/" & $temp[0]
            Return $ret
        EndIf
    Next
    
EndFunc


Func _GetAchewoodLink()
    Local $ret[2] = ['', '']
    
    $source = _InetGetSource('http://achewood.com/')
    $sourceX = StringSplit($source, @CRLF) 
    $keepX = 0
    
    For $i = 0 to UBound($sourceX) - 1
        $pos = StringInStr($sourceX[$i], 'http://m.assetbar.com/achewood/one_strip')
        If $pos > 0 then 
            $keep = _StringBetween($sourceX[$i], 'http://m.assetbar.com/achewood/one_strip', '" >discuss')
            If IsArray($keep) then 
                $keepX = $keep[0]
            Else 
                Return ""
            EndIf 
            ExitLoop 
        EndIf 
    Next 

    $source = _InetGetSource('http://m.assetbar.com/achewood/one_strip' & $keepX)
    $sourceX = StringSplit($source, @CRLF) 
    
    For $i = 0 to UBound($sourceX) - 1
        $pos = StringInStr($sourceX[$i], '<img src="http://M.assetbar.com/')
        If $pos > 0 then 
            $keep = _StringBetween($sourceX[$i], '<img src="http://M.assetbar.com/', '"/></a>') 
            If IsArray($keep) then 
                $ret[1] = $keep[0]
            Else 
                Return ""
            EndIf 
            ExitLoop 
        EndIf 
    Next 
    $ret[0] = 'http://M.assetbar.com/' & $ret[1]
    
    Return $ret
EndFunc

Func _GetBreakfastCerealLink()
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.smbc-comics.com/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], 'src="http://www.yityat.com/smbc/') > 0 then
            $temp = _StringBetween($array[$i], 'src="http://www.yityat.com/smbc/', '"')
            
            If IsArray($temp) then
                $ret[0] = 'http://www.yityat.com/smbc/' & $temp[0]
                $ret[1] = 'BreakfastCereal' & $temp[0]
            EndIf
            
            Return $ret
        EndIf
    Next
EndFunc 

Func _GetCalvinAndHobbesLink()
    Local $ret[2] = ['', '']
    $ret[0] = 'http://images.ucomics.com/comics/ch/' & @YEAR & '/ch' & StringTrimLeft(@YEAR, 2) & @MON & @MDAY & '.gif'
    $ret[1] = 'ch' & StringTrimLeft(@YEAR, 2) & @MON & @MDAY & '.gif'
    Return $ret
EndFunc

Func _GetDilbertLink()
    Local $ret[2] = ['', '']
    $source = _INetGetSource('http://feeds.feedburner.com/DilbertDailyStrip')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], 'img src="http://dilbert.com/dyn') > 0 then
            $temp = _StringBetween($array[$i], 'img src="', '"')
           
            If IsArray($temp) then
                $ret[0] = $temp[0]
                $temp = StringSplit($temp[0], '/')
                $ret[1] = $temp[$temp[0]]
            EndIf
           
            Return $ret
        EndIf
    Next
    
    Return $ret
EndFunc 


Func _GetDoonesburyLink()
    Local $ret[2] = ['', '']
    $ret[0] = 'http://images.ucomics.com/comics/db/' & @YEAR & '/db' & StringRight(@YEAR, 2) & @MON & @MDAY & '.gif'
    $ret[1] = 'db' & StringRight(@YEAR, 2) & @MON & @MDAY & '.gif'
    Return $ret
EndFunc

Func _GetExplosmLink()
    Local $ret[2] = ['', '']
    $RSS = "http://www.explosm.net/comics/new/"
    $RSSSource = _INetGetSource($RSS)
    $Items = StringSplit($RSSSource, @CRLF)
    $Count = UBound($Items)
    
    Dim $Date[$Count], $Link[$Count], $Category[$Count]

    $index = _ArraySearch($items, '<div id="thebodycontent">')
    $get = 0
    $i = $index

    While $i < UBound($items) - 1
        If StringInStr($items[$i], '<img alt=') then 
            $grab = $i 
            ExitLoop
        EndIf 
        $i += 1
    WEnd    
    
    $temp = StringSplit($items[$grab], '<img alt="Cyanide and Happiness, a daily webcomic" ', 1)
        
    $test = _StringBetween($temp[2], 'src="', '"><')
        
    $ret[0] = $test[0]
    $temp = StringSplit($ret[0], '/')
    $ret[1] = $temp[$temp[0]]
    Return $ret
EndFunc


Func _GetGarfieldLink()
    Local $ret[2] = ['', '']
    $ret[0] = 'http://images.ucomics.com/comics/ga/' & @YEAR & '/ga' & StringTrimLeft(String(@YEAR), 2) & @MON & @MDAY & '.gif'
    $ret[1] = 'ga' & StringTrimLeft(String(@YEAR), 2) & @MON & @MDAY & '.gif'
    Return $ret
EndFunc

Func _GetGetFuzzyLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/getfuzzy/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/getfuzzy/archive/images/getfuzzy') > 0 then
            $temp = _StringBetween($array[$i], 'images/getfuzzy', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/getfuzzy/archive/images/getfuzzy' & $temp[0]
                $ret[1] = 'getfuzzy' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc


Func _GetMontyLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/monty/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/monty/archive/images/monty') > 0 then
            $temp = _StringBetween($array[$i], 'images/monty', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/monty/archive/images/monty' & $temp[0]
                $ret[1] = 'monty' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc


Func _GetroseisroseLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/roseisrose/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/roseisrose/archive/images/roseisrose') > 0 then
            $temp = _StringBetween($array[$i], 'images/roseisrose', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/roseisrose/archive/images/roseisrose' & $temp[0]
                $ret[1] = 'roseisrose' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc


Func _GetarlonjanisLink() 
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.comics.com/comics/arlonjanis/')
    $array = StringSplit($source, @CRLF)

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/arlonjanis/archive/images/arlonjanis') > 0 then
            $temp = _StringBetween($array[$i], 'images/arlonjanis', '"') 
            
            If IsArray($temp) then 
                $ret[0] = 'http://www.comics.com/comics/arlonjanis/archive/images/arlonjanis' & $temp[0]
                $ret[1] = 'arlonjanis' & $temp[0]
            EndIf
            
            Return $ret
        EndIf 
    Next
EndFunc



Func _GetPeanutsLink()
    Local $ret[2] = ['', '']
    $source = _InetGetSource('http://www.unitedmedia.com/comics/peanuts/') 
    $array = StringSplit($source, @CRLF)    

    For $i = 1 to UBound($array) - 1
        If StringInStr($array[$i], '<IMG SRC="/comics/peanuts/archive/images/peanuts') > 0 then
            $temp = _StringBetween($array[$i], 'peanuts', '"') 
            If IsArray($temp) then 
                $ret[0] = 'http://www.unitedmedia.com/comics/peanuts' & $temp[1]
                $temp = StringSplit($temp[1], '/')
                $ret[1] = $temp[$temp[0]]
            EndIf
            Return $ret
        EndIf 
    Next
EndFunc

Func _GetXkcdLink()
    Local $ret[2] = ['', '']
    $RSS = "http://www.xkcd.com/rss.xml"
    $RSSSource = _INetGetSource($RSS)
    $Items = StringRegExp($RSSSource, "(?i)(?s)<item>.*?</item>", 3)
    $Count = UBound($Items)
    $Dummy = _StringBetween($Items[0], '&lt;img src="', '"')
    $ret[0] = $Dummy[0]
    $temp = StringSplit($ret[0], '/') 
    $ret[1] = $temp[$temp[0]]
    Return $ret
EndFunc




Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($s_Body, "<") And StringInStr($s_Body, ">") Then
        $objEmail.HTMLBody = $s_Body
    Else
        $objEmail.Textbody = $s_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
        For $x = 1 To $S_Files2Attach[0]
            $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
            If FileExists($S_Files2Attach[$x]) Then
                $objEmail.AddAttachment($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @LF & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                Return 0
            EndIf
        Next
    EndIf
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
    If $s_Username <> "" Then
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $ssl Then
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
    $objEmail.Configuration.Fields.Update
    $objEmail.Send
    If @error Then
        SetError(2)
        Return $oMyRet[1]
    EndIf
EndFunc  ;==>_INetSmtpMailCom

-- If the apocalypse comes... beep me.

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...