| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
PastebinAPI
Pastebin API interaction object.
Public functions:
paste -- Pastes a user-specified file or string using the new API-key POST method.
legacy_paste -- Pastes a user-specified file or string using the old anonymous POST method.
generate_user_key -- Generates a session-key that is required for other functions.
pastes_by_user -- Returns all public pastes submitted by the specified login credentials.
trending -- Returns the top trending paste.
user_details -- Returns details about the user for the specified API user key.
delete_paste -- Adds two numbers together and returns the result.
|
|||
|
|||
| string |
|
||
| string |
|
||
| string |
|
||
| string |
|
||
| string |
|
||
| string |
|
||
| string |
|
||
|
Inherited from |
|||
|
|||
_bad_request =
|
|||
_base_domain =
|
|||
_prefix_url =
|
|||
_subdomain_url =
|
|||
_legacy_api_url =
|
|||
_api_url =
|
|||
_api_login_url =
|
|||
paste_expire_date =
|
|||
paste_private =
|
|||
paste_format =
|
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see help(type(x)) for signature
|
Delete the paste specified by the api_paste_key. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> paste_to_delete = x.delete_paste('453a994e0e2f1efae07f8759e59e075b',
... 'c57a18e6c0ae228cd4bd16fe36da381a',
... 'WkgcTFtv')
>>> print paste_to_delete
Paste Removed
|
Return user details of the user specified by the api_user_key. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> details = x.user_details('453a994e0e2f1efae07f8759e59e075b',
... 'c57a18e6c0ae228cd4bd16fe36da381a')
>>> print details
<user>
<user_name>MonkeyPuzzle</user_name>
<user_format_short>python</user_format_short>
<user_expiration>N</user_expiration>
<user_avatar_url>http://pastebin.com/i/guest.gif</user_avatar_url>
<user_private>0</user_private>
<user_website></user_website>
<user_email>user@email.com</user_email>
<user_location></user_location>
<user_account_type>0</user_account_type>
</user>
|
Returns the top trending paste details. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> details = x.trending('453a994e0e2f1efae07f8759e59e075b')
>>> print details
<paste>
<paste_key>jjMRFDH6</paste_key>
<paste_date>1333230838</paste_date>
<paste_title></paste_title>
<paste_size>6416</paste_size>
<paste_expire_date>0</paste_expire_date>
<paste_private>0</paste_private>
<paste_format_long>None</paste_format_long>
<paste_format_short>text</paste_format_short>
<paste_url>http://pastebin.com/jjMRFDH6</paste_url>
<paste_hits>6384</paste_hits>
</paste>
Note: Returns multiple trending pastes, not just 1.
|
Returns all pastes for the provided api_user_key. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> details = x.user_details('453a994e0e2f1efae07f8759e59e075b',
... 'c57a18e6c0ae228cd4bd16fe36da381a',
... 100)
>>> print details
<paste>
<paste_key>DLiSspYT</paste_key>
<paste_date>1332714730</paste_date>
<paste_title>Pastebin.py - Python 3.2 Pastebin.com API</paste_title>
<paste_size>25300</paste_size>
<paste_expire_date>0</paste_expire_date>
<paste_private>0</paste_private>
<paste_format_long>Python</paste_format_long>
<paste_format_short>python</paste_format_short>
<paste_url>http://pastebin.com/DLiSspYT</paste_url>
<paste_hits>70</paste_hits>
</paste>
Note: Returns multiple pastes, not just 1.
|
Generate a user session key - needed for other functions. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> my_key = x.generate_user_key('453a994e0e2f1efae07f8759e59e075b',
... 'MonkeyPuzzle',
... '12345678')
>>> print my_key
c57a18e6c0ae228cd4bd16fe36da381a
|
Submit a code snippet to Pastebin using the new API. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> url = x.paste('453a994e0e2f1efae07f8759e59e075b' ,
... 'Snippet of code to paste goes here',
... paste_name = 'title of paste',
... api_user_key = 'c57a18e6c0ae228cd4bd16fe36da381a',
... paste_format = 'python',
... paste_private = 'unlisted',
... paste_expire_date = '10M')
>>> print url
http://pastebin.com/tawPUgqY
|
Unofficial python interface to the Pastebin legacy API. Unlike the official API, this one doesn't require an API key, so it's virtually anonymous. Usage Example:
>>> from pastebin import PastebinAPI
>>> x = PastebinAPI()
>>> url = x.legacy_paste('Snippet of code to paste goes here',
... paste_name = 'title of paste',
... paste_private = 'unlisted',
... paste_expire_date = '10M',
... paste_format = 'python')
>>> print url
http://pastebin.com/tawPUgqY
|
|
|||
paste_format
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Apr 10 17:12:56 2012 | http://epydoc.sourceforge.net |