Wie loggen Sie sich mit Reddit API?

Versuche auf meine Reddit Benutzer-Konto mit der Reddit API - POST-login-Endpunkt aufgeführt, die auf der API-Seite.

Habe ich versucht, dieses:

curl -i -X POST -d '{"user":"myusername", "passwd":"mypassword", "rem":"true" }' http://www.reddit.com/api/login

Aber es sagt Falsches Passwort (habe ich auf der website angemeldet mit den gleichen Anmeldeinformationen, also ich weiß nicht, was falsch ist):

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
    "jquery": 
             [[0, 1, "call", ["body"]], [1, 2, "attr", "find"], 
              [2, 3, "call", [".status"]], [3, 4, "attr", "hide"], 
              [4, 5, "call", []],  [5, 6, "attr", "html"], 
              [6, 7, "call", [""]], [7, 8, "attr", "end"], 
              [8, 9, "call", []], [0, 10, "attr", "find"], 
              [10, 11, "call", [".error.WRONG_PASSWORD.field-passwd"]], 
              [11, 12, "attr", "show"], [12, 13, "call", []], 
              [13, 14, "attr", "text"], [14, 15, "call", ["invalid password"]], 
              [15, 16, "attr", "end"], [16, 17, "call", []]]
 }

Funktioniert dies jedoch:

curl -i -c Cookie.txt -d '{"user":"myusername", "passwd":"mypassword" , "rem":"true"}' http://www.reddit.com/api/login

Ergibt:

{
     "jquery": 
              [[0, 1, "call", ["body"]], 
               [1, 2, "attr", "find"], 
               [2, 3, "call", [".status"]], 
               [3, 4, "attr", "hide"], 
               [4, 5, "call", []], 
               [5, 6, "attr", "html"], 
               [6, 7, "call", [""]], 
               [7, 8, "attr", "end"], 
               [8, 9, "call", []], 
               [0, 10, "attr", "find"], 
               [10, 11, "call", [".error.RATELIMIT.field-vdelay"]], 
               [11, 12, "attr", "show"], 
               [12, 13, "call", []], 
               [13, 14, "attr", "text"], 
               [14, 15, "call", 
                 ["you are doing that too much. try again in 4 minutes."]],
               [15, 16, "attr", "end"], [16, 17, "call", []]]
}

Diese auch so gut funktioniert:

curl -b Cookie.txt http://www.reddit.com/api/me.json

Fragen:

  • Weiß jemand, wie man login auf Reddit über die Reddit API?

  • Gibt es ein einfacher Weg für die übergabe von Anmeldeinformationen über einen HTTP-Post zu login-richtig?

  • Warum sagt er ungültiges Passwort von meinem ersten LOCKE?

Schreibe einen Kommentar