Category:CypherTech: Difference between revisions

From Traxel Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 23: Line 23:
</syntaxhighlight>
</syntaxhighlight>
'''Real Curl Request'''
'''Real Curl Request'''
<source>
<syntaxhighlight>
curl
curl
   -X POST
   -X POST
Line 29: Line 29:
   --user 'client_id:client_secret'
   --user 'client_id:client_secret'
   https://www.reddit.com/api/v1/access_token
   https://www.reddit.com/api/v1/access_token
</source>
</syntaxhighlight>
'''One Line'''
'''One Line'''
<source>
<syntaxhighlight>
curl -X POST -d 'grant_type=client_credentials' --user 'client_id:client_secret' https://www.reddit.com/api/v1/access_token
curl -X POST -d 'grant_type=client_credentials' --user 'client_id:client_secret' https://www.reddit.com/api/v1/access_token
</source>
</syntaxhighlight>
'''Oauth Data Call'''
'''Oauth Data Call'''
<source>
<syntaxhighlight>
$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/api/v1/me
$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/api/v1/me
$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/r/news/top?t=day&limit=100
$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/r/news/top?t=day&limit=100
</source>
</syntaxhighlight>
* https://old.reddit.com/r/worldnews/top/?sort=top&t=day
* https://old.reddit.com/r/worldnews/top/?sort=top&t=day
* /r/subreddit/top?t=day&limit=100
* /r/subreddit/top?t=day&limit=100

Revision as of 19:04, 18 August 2023

Interesting Subreddits

  • politics
  • news
  • worldnews
  • askreddit
  • askscience
  • conservative
  • dataisbeautiful

Reddit OAuth2

Example Curl Request

curl
  -X POST
  -d 'grant_type=password&username=reddit_bot&password=snoo'
  --user 'p-jcoLKBynTLew:gko_LXELoV07ZBNUXrvWZfzE3aI'
  https://www.reddit.com/api/v1/access_token

Real Curl Request

curl
  -X POST
  -d 'grant_type=client_credentials'
  --user 'client_id:client_secret'
  https://www.reddit.com/api/v1/access_token

One Line

curl -X POST -d 'grant_type=client_credentials' --user 'client_id:client_secret' https://www.reddit.com/api/v1/access_token

Oauth Data Call

$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/api/v1/me
$ curl -H "Authorization: bearer J1qK1c18UUGJFAzz9xnH56584l4" -A "Traxelbot/0.1 by rbb36" https://oauth.reddit.com/r/news/top?t=day&limit=100

Reddit Python

pip install aiofiles aiohttp asyncio

Pages in category "CypherTech"

The following 7 pages are in this category, out of 7 total.