DrDoug Posted December 12, 2012 Share Posted December 12, 2012 (edited) searching for craigsliston the general help and supportforum and looking at some of the existing posts, I can figure out how to get to the HTML on my CL account page. Once I find a listing that has an option to renewit, how is that renew action triggered programmaticallly?here's the item that needs to be renwed, with the values obfuscated.<td><form action="[url="https://post.craigslist.org/manage/nnn"]https://post.craigslist.org/manage/nnn"[/url] method="POST"><input type="hidden" name="U2FsdGVkX18yODc5O:TI4Nw.oKrVIl0UARegrhuSj8zLZUCoKaeo3nnn" value="renew"><input type="hidden" name="U2Fs.dGVkX18yODc5OTI4N0BY:4eHT9YG4DOZqERyFo7RVws8QosOnnn" value="U2FsdGVkX18yODc5OTI4N0fP6qcCPRX5I8nR1wAXxFjvd2EI24bnnn"><input type="submit" name="go" value="renew" class="managebtn"></form></td>there's got to be a simple way for a function call to trigger a form action just like a mouse click on the page, but I can't wrap my head around where to go or what to look for in the language guide. I can't tell if I'm doing this the simple way or the hard way, and I don't know how close I am to the finish line. I just don't know. so, any help? I don't need hand holding, but pointers to other code or clues on what calls to look as I investigate would be great.i've always made the most progress looking at others' existing code.thanks Edited December 12, 2012 by DrDoug Link to comment Share on other sites More sharing options...
DrDoug Posted December 17, 2012 Author Share Posted December 17, 2012 Bump. 57 views, but no replies. Am I stumping everybody, or am I being ignored because I'm being too much of a n00bie? ;-) Doug Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 17, 2012 Moderators Share Posted December 17, 2012 DrDoug, Welcome to the AutoIt forum. No-one is ignoring you, but you need to remember that this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PowerCat Posted December 17, 2012 Share Posted December 17, 2012 (edited) Hello DrDoug, I've written a few script for craigslist, so I would like to help you out! However, I have to be very honest with you, I don't understand the question. What I like to do is use "inetread" to get the source of the HTML page, then I use StringRegExp to take out what I want from the "ad". $url = "whatever" $binhtml = InetRead($url) $html = BinaryToString($binhtml) ; $html now contains the source code of the page ; now I format the post into a one-line string, with | as a separator of the values that I want. $title_regex = '(?i:postingTitle.=.")(.*?)"' $title = StringRegExp($html, $title_regex, 1) if $logging = 1 and @error then _FileWriteLog($logfile, "Could not get title for post @ " & $url) $email_regex = '(?i:displayEmail.=.")(.*?)"' $email_address = StringRegExp($html, $email_regex, 1) if $logging = 1 and @error then _FileWriteLog($logfile, "Could not get email address for post @ " & $url) $body_regex = '(?s)<section id="userbody">(.*?)<script type="text/javascript">' $body = StringRegExp($html, $body_regex, 1) if $logging = 1 and @error then _FileWriteLog($logfile, "Could not get body for post @ " & $url) $pics_regex = '<(?i:a href=")(.*?)" title=".">' $pics = StringRegExp($html, $pics_regex, 3) $pics_url = _ArrayToString($pics, ',') if $logging = 1 and @error then _FileWriteLog($logfile, "Could not get pics url for post @ " & $url) $final = $title[0] & "|" & $email_address[0] & "|" & $body[0] & "|" & $pics_url $final = StringReplace($final, Chr(10), Chr(13)) $final = StringStripCR($final) $Formatted_Ad = StringStripWS($final, 7) If you have more clear info on what you're trying to find, I can help you out somewhere. Maybe you can take a screenshot of the page? Edited December 17, 2012 by PowerCat Link to comment Share on other sites More sharing options...
baconismidog Posted February 17, 2015 Share Posted February 17, 2015 Necroing: I have this same issue. I'll try to explain it a different way. In the Craigslist account page, you can choose to 'renew' your posts every three days and then they'll get a fresh look from people. What we're trying to figure out is how to manage the POST command correctly. Here is the "inspect element" in Chrome for the "renew" hyperlink in the account page (I blanked out my account number with ##): <form action="https://post.craigslist.org/manage/##########" method="POST"><input type="hidden" name="action" value="renew"><input type="hidden" name="crypt" value="U2FsdGVkX182NDQ0NjQ0NNYTGOKaJXDu34zUjkZCkVXDzwxZxSW1KA"><input type="submit" name="go" value="renew" class="managebtn"></form> I know how to use string-in-string etc. to parse out the URL, actions, values, etc but what I can't get correct is the formatting for the POST command itself. I've tried including and exlcuding different parts (action, value, crypt, etc.). I get a 200 returned using the code below but it doesn't actually renew the post. I know the crypt values are different, they change regularly. ; The data to be sent $sPD = 'action=/manage/##########&name=action&value=renew&name=crypt&value=U2FsdGVkX182MzM0NjMzNOpDZW1SVeBDug_VuldCvGPgwoMzcrXJZA' ; Creating the object $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "https://post.craigslist.org", False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; Performing the Request $oHTTP.Send($sPD) ; Download the body response if any, and get the server status response code. $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ;If $oStatusCode <> 200 then MsgBox(4096, "Response code", $oStatusCode) ;EndIf ; Saves the body response regardless of the Response code $file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $oReceived) FileClose($file) Thanks for the help guys - I plan to write this up and give it away (the current batch of CL renew apps are really friggin expensive). Link to comment Share on other sites More sharing options...
theak Posted April 21, 2016 Share Posted April 21, 2016 (edited) On 2/16/2015 at 8:34 PM, baconismidog said: Necroing: I have this same issue. I'll try to explain it a different way. In the Craigslist account page, you can choose to 'renew' your posts every three days and then they'll get a fresh look from people. What we're trying to figure out is how to manage the POST command correctly. Here is the "inspect element" in Chrome for the "renew" hyperlink in the account page (I blanked out my account number with ##): <form action="https://post.craigslist.org/manage/##########" method="POST"><input type="hidden" name="action" value="renew"><input type="hidden" name="crypt" value="U2FsdGVkX182NDQ0NjQ0NNYTGOKaJXDu34zUjkZCkVXDzwxZxSW1KA"><input type="submit" name="go" value="renew" class="managebtn"></form> I know how to use string-in-string etc. to parse out the URL, actions, values, etc but what I can't get correct is the formatting for the POST command itself. I've tried including and exlcuding different parts (action, value, crypt, etc.). I get a 200 returned using the code below but it doesn't actually renew the post. I know the crypt values are different, they change regularly. ; The data to be sent $sPD = 'action=/manage/##########&name=action&value=renew&name=crypt&value=U2FsdGVkX182MzM0NjMzNOpDZW1SVeBDug_VuldCvGPgwoMzcrXJZA' ; Creating the object $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "https://post.craigslist.org", False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; Performing the Request $oHTTP.Send($sPD) ; Download the body response if any, and get the server status response code. $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ;If $oStatusCode <> 200 then MsgBox(4096, "Response code", $oStatusCode) ;EndIf ; Saves the body response regardless of the Response code $file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $oReceived) FileClose($file) Thanks for the help guys - I plan to write this up and give it away (the current batch of CL renew apps are really friggin expensive). Any luck with this? Trying to search the forums for something similar and this is the only post I found. Edited April 21, 2016 by theak spelling Link to comment Share on other sites More sharing options...
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