DirtDBaK Posted October 1, 2007 Posted October 1, 2007 Use _IELinkClickByText($oIE, "next 100 postings")_IELoadWait($oIE)and then start over...Dalep.s. Check the return status of _IELinkClickByText to see if it found a link for the next 100 or not...Also, as mentioned earlier, _IECreate has a parameter for invisible. _IEQuit kills the windowCheck out the new soucre and see what you think ..... and ill have to use the help file to make it invis then [center][/center]
phatzilla Posted October 1, 2007 Author Posted October 1, 2007 the thing is, you dont really NEED 9500 items because it's just too far back. My intention with this 'idea' was so you can be one of the first to get the latest bites without actually camping craigslist.
phatzilla Posted October 1, 2007 Author Posted October 1, 2007 Hey guys is there any way to make it so when the traytip comes up, if you click on it, it takes you directly to the .htm file
DirtDBaK Posted October 1, 2007 Posted October 1, 2007 maybe with au3 lib but i dont have that ..... I could make it auto launch the htm but thats my only idea... [center][/center]
DirtDBaK Posted October 1, 2007 Posted October 1, 2007 maybe ill use your method and just do two pages... [center][/center]
DirtDBaK Posted October 1, 2007 Posted October 1, 2007 Ok heres the new source.....It only does two pages and it fixes a minor error that every 20 mins didnt delete results....So check it out it uses dalehohm's method to get the first 200 items!expandcollapse popup#include <IE.au3> #include <Array.au3> While 1 FileDelete( @ScriptDir & "\Results.htm" ) FileDelete( @scriptdir & "\Results.ini" ) $oIE = _IECreate("http://dayton.craigslist.org/sss/") ;not sure how to hide ;<---CAHNGE TO YOUR URL!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $oPs = _IETagNameGetCollection($oIE, "p") $cntPs = @extended Global $aLinkInfo[200][3] ;<---ALLOWS FOR 95 PAGES (9500 ITEMS) !!!!!!!!!!!!!!!! This is Pages * 100 $aLinkInfo[0][0] = "Index" $aLinkInfo[0][1] = "Link Text" $aLinkInfo[0][2] = "href" $cnt = 1 For $oP in $oPs $oLink = _IETagNameGetCollection($oP, "a", 0) $aLinkInfo[$cnt][0] = $cnt - 1 $aLinkInfo[$cnt][1] = $oLink.innerText $aLinkInfo[$cnt][2] = $oLink.href $cnt +=1 Next _IELinkClickByText($oIE, "next 100 postings") ;moving on to page 2 _IELoadWait($oIE) $oPs = _IETagNameGetCollection($oIE, "p") For $oP in $oPs $oLink = _IETagNameGetCollection($oP, "a", 0) $aLinkInfo[$cnt][0] = $cnt - 1 $aLinkInfo[$cnt][1] = $oLink.innerText $aLinkInfo[$cnt][2] = $oLink.href $cnt +=1 Next $y = 0 $terms = IniReadSection( @SCRIPTDIR & "\Settings.ini", "Terms" ) ;compare and find results For $i = 1 to $terms[0][0] step 1;to compare for every term For $x = 1 to $cnt-1 step 1;compare that term to every result If StringInStr( $aLinkInfo[$x][1], $Terms[$i][1] ) <> 0 Then $y=$y+1 IniWrite( @ScriptDir & "\Results.ini", "Results", $alinkinfo[$x][1], $alinkinfo[$x][2] ) Endif Next Next $results = IniReadSection( @SCRIPTDIR & "\Results.ini", "Results") If $y <>0 Then $file = FileOpen( @ScriptDir & "\Results.htm", 9 ) ;write page header FileWriteLine( $file, '<h2>AutoIT Search Companion for Craigs List Found <b>' & $y & '</b> results that matched your search criteria!</h2>' & @CRLF ) For $u = 1 to $results[0][0] step 1 FileWriteLine( $file, '<p><a href="' & $results[$u][1] & '">' & $results[$u][0] & '</a></p>' & @CRLF ) ;write links and data Next FileClose($File) TrayTip( "Craigs List Results", "Search Found " & $y & " items!", 5000 );results Sleep(5000) TrayTip("","",0) Else FileClose($File) TrayTip( "Craigs List Results", "Inconclusive Search (0 Results)", 5000 );for no results Sleep(5000) TrayTip("","",0) EndIf ;ShellExecute( @Scriptdir & "\Smpt.exe", @Scriptdir & "\Results.htm" ) ;UES THIS LINE TO USE SMPT Sleep((1000*60)*20);20 min Sleep Wend;start all overAny Luck on the SMPT ??? Maybe when we finish we should put this on the Example Scripts... [center][/center]
phatzilla Posted October 1, 2007 Author Posted October 1, 2007 (edited) $site= "http://toronto.craigslist.org/ele/"$oIE = _IECreate($site,0,0,1,-1)Now that works, it would be nice if you can altar the ini under a new section [site] for example and then input any site you want and the program would navagate to that site.For example:$site = IniReadSection( @SCRIPTDIR & "\Settings.ini", "Site" )$oIE = _IECreate($site,0,0,1,-1)My INI : [site]http://toronto.craigslist.org/ele/For some reason that code doesnt workEdit : Nevermind, i got it!$site = IniRead( @SCRIPTDIR & "\Settings.ini", "Site" , "Site", "default" )[site]Site=http://toronto.craigslist.org/ele/ Edited October 1, 2007 by phatzilla
DirtDBaK Posted October 1, 2007 Posted October 1, 2007 $site= "http://toronto.craigslist.org/ele/" $oIE = _IECreate($site,0,0,1,-1) Now that works, it would be nice if you can altar the ini under a new section [site] for example and then input any site you want and the program would navagate to that site. For example: $site = IniReadSection( @SCRIPTDIR & "\Settings.ini", "Site" ) $oIE = _IECreate($site,0,0,1,-1) My INI : [site] http://toronto.craigslist.org/ele/ For some reason that code doesnt work Thats becuz inireadsection returns a 2 dim array u have to use this $site = IniRead( @SCRIPTDIR & "\Settings.ini", "Site", "Site", "About:blank" ) $oIE = _IECreate($site,0,0,1,-1) That way it will read the ini like so: [site] site=http://toronto.craigslist.org/ele/ [term] 1=jeep 2=computer ...... and if you dont put the value in the ini it will defualt at about:Blank [center][/center]
DirtDBaK Posted October 1, 2007 Posted October 1, 2007 Well good night guys ill be back on tommorrow about 3:45 [center][/center]
Freedom1 Posted October 24, 2007 Posted October 24, 2007 Well good night guys ill be back on tommorrow about 3:45I've been modifying this program to get it right for me. Does anyone know how to include the location (Henderson/Las Vegas, below) that displays on Craig's list after the Link and the orange "pic" to indicate there is a picture? As in:1994 Suzuki Katana GSX600F - $1999 (Henderson/Las Vegas) picI'd like to capture and display those items on the "Results" html.Freedom1
ghetek Posted October 29, 2007 Posted October 29, 2007 you guys over complicate this..http://sfbay.craigslist.org/search/zip?que...&format=rssRSS is standard. use it.
weaponx Posted October 29, 2007 Posted October 29, 2007 you guys over complicate this..http://sfbay.craigslist.org/search/zip?que...&format=rssRSS is standard. use it.Man. Why would they have done that, no challenge involved.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now