Guest User

Untitled

a guest
Jul 2nd, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. https://ssl.reddit.com/api/login?api_type=json&user=XXX&passwd=XXX&rem=True
  2.  
  3. https://en.reddit.com/api/comment?api_type=json&text=7/1/15TEST&thing_id=t1_csa56v2
  4.  
  5. User-Agent: XXX
  6. Cookie: reddit_session=XXX
  7. X-Modhash: XXXX
  8.  
  9. $name = 't1_csa56v2';
  10. $text = 'NEWEST TEST 7/2/15 12:20am';
  11. $url = 'https://en.reddit.com/api/comment';
  12.  
  13. $modhash = 'XXX';
  14. $cookie = 'XXX';
  15.  
  16. $headerFields = array (
  17. 'User-Agent' => 'XXX',
  18. 'Cookie' => 'reddit_session='.$cookie,
  19. 'X-Modhash' => $modhash
  20. );
  21.  
  22. $postFields = array (
  23. 'api_type' => 'json',
  24. 'text' => $text,
  25. 'thing_id' => $name
  26. );
  27.  
  28.  
  29. $field_string = http_build_query($postFields);
  30.  
  31. $ch = curl_init($url);
  32. curl_setopt($ch, CURLOPT_HTTPHEADER, $headerFields);
  33. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  34. curl_setopt($ch,CURLOPT_POST, 3);
  35. curl_setopt($ch,CURLOPT_POSTFIELDS, $field_string);
  36. $response = curl_exec($ch);
Add Comment
Please, Sign In to add comment