It's a simple API for pasta.cf written in python. It can:
- create pasta of all types ( except url shortener )
- remove pasta
- edit and existing pasta
- read a pasta
Built with Cmd+Alt+I on Chromium, on pasta.cf. ( Devel. console )
Brought to you by , because I'm a top level narcissic.
You need to have requests
installed on your system, for your specific version of python.
<censored due to google finding this file; basically, git clone and pip install>
Now move pastacfapi.py to the root file of your project ( or somewhere in your $PYTHONPATH )
import pastacfapi
pastacfapi.create(paste_title, paste_text, paste_type)
import pastacfapi
paste = pastacfapi.create("PASTA-CF-API", "Wow, this API is really great, thanks to <censored due to google>, <3", pastacfapi.SELF_BURNING)
print("Paste url is: " + paste.url)
- create(title, text, type)
Return a pasta_object
- remove(pasta-token, password)
Remove a pasta. Return nothing
- edit(pasta-token, password, title, text)
Edit an already created pasta. Only work with editable pasta. Return nothing
- read(pasta-token)
Return a string containing the text of the pasta specified.
SELF_BURNING
EDITABLE
STANDARD
Side note: URL_SHORTENER is not supported yet.
- pasta['token']
The token of your pasta e.g: papa-sampling-random
- pasta['view']
It's the standard user GUI url to see the pasta you just created.
- pasta['raw']
It's the raw GUI of your pasta, without fireworks.
- pasta['password']
It's the password of the paste you just created, if it's type is EDITABLE
- pasta['type']
It's the type of the paste you just created (again!), if you forgot what is was.
Implement error handling. Please, someone, do that for me, because I don't know how to do it, really :(
- You ?