This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Agent Silence's profile picture

Logging into a website using http.post

Started by Agent Silence, 09 September 2014 - 05:05 AM
Agent Silence #1
Posted 09 September 2014 - 07:05 AM
Im trying to make a program that logs into my github and updates the code
I know how to make it update the code, but I dont know how to log into the thing using http.post
Lyqyd #2
Posted 09 September 2014 - 07:50 PM
You can't establish a session with the ComputerCraft http API, as far as I know.
Agent Silence #3
Posted 09 September 2014 - 08:02 PM
You can't establish a session with the ComputerCraft http API, as far as I know.
hmmm, that sucks
is there any way to tell if it logged in though?
natedogith1 #4
Posted 10 September 2014 - 12:23 AM
Are you attempting to use the web page meant for people, or the http api meant for robots?
Agent Silence #5
Posted 10 September 2014 - 12:52 AM
Are you attempting to use the web page meant for people, or the http api meant for robots?
Im trying to use the http api to login to github using http.post, but i dont know how to post the credentials onto the page

I use a scanner to check the webpage whenever it returns the source code
and if it matches the source code of the homepage then it returns success
natedogith1 #6
Posted 10 September 2014 - 04:01 AM
Since you're trying to use the webpage meant for people, you'd need to parse https://github.com/login and send it back the hidden values it generates along with your username and password. So I think it'd be something along the lines of

http.post("https://github.com/login","utf8="..utf8.."&authenticity_token="..authenticity_token.."&login="..username.."&password="..password)
Though if possible, you should probably try and use GitHub's api.