viewing revision from 3 years ago

WIKI TOOLS

-

index

viewhistorytalk

RSAW

RSAW is a really light API wrapper, created for this here website. I (/u/diogenesjunior) created it because Saidit didn't have a Python API wrapper, and I personally needed to use Saidit programatically.

Installation

Installing RSAW is easy, assuming you have pip3 installed:

pip3 install RSAW

Credentials

To get all of your needed API creds:

  • Go to /prefs/apps
  • Select "are you a developer? create an app..."
  • Name it "RSAW Testing"
  • Select "script"
  • Leave a small description about your project
  • Leave the about url empty
  • Put a link to the logged in account's profile for the redirect uri

You can then start using the API wrapper. I suggest you at least learn some Python first. Here's a small rundown of how you'd use it:

  • Create a file named "main.py"
  • Copy and paste the following into main.py:

    from rsaw import saidit
    
    saidit = saidit(client_id='client_id',
                    client_secret='client_secret',
                    username='username',
                    password='password',
                    app='our_app',
                    token_file='/tmp/token')
    me = saidit.get('/api/v1/me')
    print(me)
    
  • Replace 'client_id' with the personal use script

  • Replace 'client_secret' with the secret

  • Replace 'username' with your username

  • Replace 'password' with your password

  • Replace 'our_app' with a simple user agent


revision by [deleted]— view source