Can REBOL send to web site, like...

Started by Gs on 7-Aug-2013/13:05:07-7:00
http://the contest.com/u/soupysales?vote_from=Dr+Frankenstein Can you submit this directly to a Site, or change what's in the browser bar?
Sure you can do that: print read http://google.com/search?q=test or write %test.html read http://google.com/search?q=test you can also POST to a form using /CUSTOM refinement url: http://example.com/cgi-bin/form.cgi data: read/binary %localfile.exe result: read/custom url reduce ['post data] See the links below for further info: http://www.rebol.net/cookbook/ http://www.rebol.net/cookbook/recipes/0059.html http://www.rebol.net/cookbook/recipes/0026.html http://stackoverflow.com/questions/8691754/how-to-send-an-http-post-with-a-custom-header-using-rebol http://www.codeconscious.com/rebol/rebol-net.html#HTTP
So, this would submit a Vote? {Assuming that they had the oversight to count a vote whhen the name in the browser bar is changed, and Enter is pressed} print read http://voting.contest.com/u/Soupy_Sales?vote=Gayle+Winters How could you tell from a server response? Or 'could' you?
Yes, if server accepts HTTP GET request (parameters from the URL) then it would work. if it accepts only POST data then you need to use the other solutions. (read/custom) READ function returns the server response (an HTML web site, most probably) Then you can search for a word to see if it was successful or not. Let's say server response is one of: <html><body>Thanks for voting<body><html> or <html><body>An error occured<body><html> s: read http://vote.com/vote=Gayle+Winters either find s "error" [ alert "Error!" ] [ alert "Success!" ]
I did: either find voteSite "successfully" [ alert "Voted!" ][ alert "Error!" ] And I got "Voted!"

Reply