Recently Browsing 0 members
No registered users viewing this page.
I have an AutoIT script It monitors 2 websites for content that applys to me and the services that I provide. One site is : www.Freelancer.com The other: www.PeoplePerHour.com Both sites publish new jobs on their site hourly or so. My AutoIT app, will view those sites and present new jobs to me in a grid that pops up on my screen. Lately, the app has stopped showing me any jobs from PeoplePerHour.
For freelancer.com, Inetget is giving full html but for peopleperhour, now its not coming.
Local Static $hTimer = 0
Local Static $hDownload = 0
Local $aTitlesandUrls = 0
Local Static $sTempFile = ""
If $hTimer = 0 Then $hTimer = TimerInit()
If $hDownload = 0 Then
$sTempFile = _WinAPI_GetTempFileName(@TempDir)
ConsoleWrite("Checking PPH..." & @CRLF)
ConsoleWrite(">Downloading..." & @CRLF)
;~ $hDownload = InetGet("http://www.peopleperhour.com/freelance-jobs", $sTempFile, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
$hDownload = InetGet("http://www.peopleperhour.com/freelance-jobs", $sTempFile, $INET_FORCERELOAD)
;~ Return 0
;~ Local $isCompleted = InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
;~ Local $isError = InetGetInfo($hDownload, $INET_DOWNLOADERROR)
;~ If TimerDiff($hTimer) > 3000 And $isError Then
;~ ConsoleWrite("!PPH Fail" & @CRLF)
;~ $hDownload = 0
;~ Return 0
Local $Show = 0
;~ If TimerDiff($hTimer) > 3000 And $isCompleted Then
If $hDownload > 0 Then
ConsoleWrite("+Downloaded..." & @CRLF)
Local $sPPHHtml = FileRead($sTempFile)
$aTitlesandUrls = _StringBetween($sPPHHtml, '"title">' & @LF, 'time>')
Local $sTitle = ""
Local $sUrl = ""
Local $sID = ""
Local $sDate = ""
For $i = 0 To UBound($aTitlesandUrls) - 1
$sTitle = _StringBetween($aTitlesandUrls[$i], '<a title="', '" class')
$sUrl = _StringBetween($aTitlesandUrls[$i], 'href="', '">')
$sDate = _GetDate($aTitlesandUrls[$i])
If IsArray($sTitle) And IsArray($sUrl) Then
$sID = _GetID($sUrl)
;~ _ArrayAdd($aPPH, $sDate & "|" & $sTitle & "|" & $sUrl & "|" & $sID)
$iRet = _BuildPopupsPPH($sID, $sDate, "PPH: " & $sTitle, $sUrl)
If $iRet Then $Show+=1
;~ If $Show > 0 Then ShowLatestJobs()
$hDownload = 0
$hTimer = 0
Some of you might find this little program I whipped up yesterday, to be useful. I had a need and it was filled.
It is pretty basic and I admit was pretty much slapped together speedily and then fine tuned some time later, and could certainly do with more improving, if you care to do so.
Thanks to Jefrey for his 'parse.au3' for the PHP elements. Source found here. I also used my Dropbox code, found here.
Gutenberg Project page I used for the screenshot - http://www.gutenberg.org/ebooks/1965
One of their links looks like - http://www.gutenberg.org/ebooks/1965.epub.images?session_id=5932cd1d25afee6150a958323abd8a32d68249a7
V1.3 v1.6 v2.0
Basically, the Download Dropbox program aims to simplify and speed up downloading of files, with Batch and easy sub-folder creation.
Everything in the program is done by either Drag & Drop or clicking a button. Window floats on top of others, naturally.
1. Drag a folder to the Destination input field to set the destination path.
2. Highlight some text, then drag that text to the drop zone (top edit field), to create the first sub-folder (if you want one). Click the SUB FOLDER button to assign it.
3. Do the same for the next sub-folder (if you want one or instead of the other sub folder). Click the TITLE button to assign it.
4. Select and drag a link (URL) to the drop zone. Click the ADD button to have it added to the Download list (last field).
5. Repeat for more files, that you wish to send to the same destination.
6. Click the DOWNLOAD button to have them start downloading.
If size of each download can be determined, you will see the Progress bar working.
All the buttons & List have a CTRL key feature, some also have a SHIFT key one. See the Program Information dialog for details.
Drop zone and other inputs, can also be typed or pasted into.
Some settings are saved to INI file and recalled on subsequent executions or the click of a button with CTRL held down.
NOTE - I particularly like the Text Drag ability, as that simplifies things when doing lots of sub-folders. No browsing required.
ADVICE - Clicking an entry in the list field, will momentarily display its full link text in the drop zone. Entries on the List are not sorted, so they appear in the order added. Obviously I wanted the program to take up as least desktop space as feasible, so that means truncated list entries etc.
WARNING - Before doing a bunch of links from a site, where the links are not straight forward, do a test run of one. Especially as there is currently no STOP button.
Downloads Dropbox v2.1.zip (see Post #11 for detail) (see Post #7 for a GOG example)
IMPROVEMENTS & LIMITATIONS
I have tailored certain elements for Gutenberg Project downloads and another site or two, so things will not work out-of-the-box for all possible download sites. That means you will have to tweak the code for some sites. Straight forward download links (no tricky php) seem to work fine. In particular, while what you might want to get downloads fine, it may be missing the file extension and not have the desired name.
Sometimes, if you drag & drop an image onto the drop zone, the image will display there, and you cannot grab its URL. In those cases, I just right click the original image, grab its URL and paste that into the drop zone. You can clear the displayed image (and any other entry in the drop zone) by holding down CTRL while clicking the DOWNLOAD button.
At this stage, you can only batch download files that you want, to the same destination. I am considering adding a multiple destination ability.
Need to add a STOP button.
P.S. This is my first second full program with the latest AutoIt.
I am using the function InetGet example in the help files on a website and getting the error 13. First, I searched the help files and the forum for a list of errors to consult to no avail. I suspect this is a 400's server reply based error but it would be nice to get more info about it.
Please help, thanks.
Hi Guys, I need help. I have searched the forum before posting and i couldn't find anything. The code below works fine when downloading files from "http" sites, but when trying to download from "https" sites, no files are downloaded. I tried different sites and I experience the same problem everywhere. Is there something I'm missing or doing wrong? Please note that I'm not a programmer and I'm new to this. I'm just using logic wherever i can to get things done. your help will be highly appreciated.
; Download a file in the background.
; Wait for the download to complete.
; Save the downloaded file to the temporary folder.
Local $sFilePath = "d:\"
; Download the file in the background with the selected option of 'force a reload from the remote site.'
Local $hDownload = InetGet("https://en.wikipedia.org/wiki/HTTPS#/media/File:Internet2.jpg", $sFilePath& "Internet2.jpg", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
; Retrieve the number of total bytes received and the filesize.
Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
Local $iFileSize = FileGetSize($sFilePath&"Internet2.jpg")
; Close the handle returned by InetGet.
; Display details about the total number of bytes read and the filesize.
MsgBox($MB_SYSTEMMODAL, "", "The total download size: " & $iBytesSize & @CRLF & _
"The total filesize: " & $iFileSize)
; Delete the file.
First script here. Thanks for taking the time.
I want to download a file from my dropbox or other cloud file host and I want autoit to read the file and proceed.
Here are the references I've gone through, it's just I'm not familiar yet with autoit so I'm looking for advice:
How would I start out downloading a text file from dropbox and if in the file there is a 1 then it will proceed with the rest of the script if there is a 0 or if the file cannot be downloaded I want it to just end.
Thank you for taking the time to read this and I apologize in advance if this seems very trivial for some but this is my first script and I'm hoping this is the correct place to ask this question.