For clarification when I talk about 'posts' or a 'post object' I do not mean a 'post' as in get/post request. But a post is just an uploaded image or video.
Example Call:
https://pr0gramm.com/api/items/get?promoted=1&older=2000
This will return all posts which are older than the post 2000 and have been in top.
Setting protmoted=1
in the api get request will get you all posts which have been in top. Promoted is also
an attribute of the returned post. Here it is the number of the post in top, so for example promoted=3000
will mean that this is the three thousandth post in top.
In order to specify which posts you want you can user older
and newer
. For example
https://pr0gramm.com/api/items/get?older=25000
will get you the posts older than the post 25000
.
If you don't specify wether you want newer or older posts: for example https://pr0gramm.com/api/items/get?id=2500000
you will get the post 2500000
and the the newer ones.
https://pr0gramm.com/api/items/get?id=2525097&flags=9
{
"atEnd": false,
"atStart": false,
"error": null,
"items": [
{
"id": 2525097,
"promoted": 0,
"up": 197,
"down": 62,
"created": 1524733667,
"deleted": 0,
"image": "2018\\/04\\/26\\/c6b285ecd87367cb.jpg",
"thumb": "2018\\/04\\/26\\/c6b285ecd87367cb.jpg",
"fullsize": "2018\\/04\\/26\\/c6b285ecd87367cb.png",
"width": 1052,
"height": 658,
"audio": false,
"source": "",
"flags": 1,
"user": "itssme",
"mark": 0
},
.
.
.
],
"ts": 1526741044,
"cache": "stream:new:9:id2525097",
"rt": 6,
"qc": 3
}
atEnd:bool
Will betrue
if the requested object is the first one
atStart:bool
Will betrue
if the requested object is the newest one
error:str
Will contain a message if a faulty request is made
For example if requesting an item that does not existerror
will be:"error"="notFound"
and items will look like"items"=null
item:list
A list containingposts
post:dict
id:int
uniqueid
of the postpromoted:int
Will be the number of the post in top. For example the post with the id2559630
is the325927
post which was in top.up:int
Number of upvotesdown:int
Number of downvotescreated:int
A timestamp fot the creation of the postdeleted:int
Default value is 0
Will be set to 1 if the post is deletedimage:str
Image address for https://img.pr0gramm.com/
For example: https://img.pr0gramm.com/2018/05/19/12140f2ac817985f.jpgthumb:str
Thumbnail for a postfullsize:str
Only for high quality images which are not getting displayed by default.
For example: https://pr0gramm.com/top/2558778 to get the image in full quality click the "+": https://full.pr0gramm.com/2018/05/18/a4e8e4ceb473b03a.jpgwidth:int
Width of the image or videoheight:int
Height of the image or videoaudio:bool
True if the video contains audiosource:str
A link if the image/video was directly uploaded from another website otherwise an emtpy stringflags:int
Flags for sfw/nsfp/nsfw/nsfl/poluser:str
Unique name of the uploader
mark:int
ts:int
rt:int
qc:int
todo
todo
todo
todo
from pr0gramm import *
api = Api("gamb", "adminadmin", "/tmp")
if api.login():
print("logged in")
else:
print("failed to log in")