Skip to content
devRant API wrapper in Python
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
pirant
samples
tests
.gitignore
.travis.yml
LICENSE
README.md
pylint.rc
requirements-dev.txt
setup.cfg
setup.py

README.md

pirant

Build Status Documentation Status Coverage Status version license GitHub contributors

devRant API wrapper in Python

from pirant import DevRant
devrant = DevRant()

# Get Top 10 Rants
topRants = devrant.get_rants("top", 10, 0)
print topRants['rants'][0]['text']

# Get Recent 10 Rants
recentRants = devrant.get_rants("recent", 10, 0)
print recentRants['rants'][0]['text']

# Get Algo 10 Rants
algoRants = devrant.get_rants("algo", 10, 0)
print algoRants['rants'][0]['text']

# Get Rant and all its comments given Rant Id
rant = devrant.get_rant_by_id(194632)
print rant['rant']['text']
print rant['comments'][0]['body']

# Get Recent 10 weekly (does not accept limit param)
rant = devrant.get_weekly_rants("recent", 10)
print rant['rants'][0]['text']

# Search Rant by keyword
searchResult = devrant.search_rants_by_keyword("devrant")
print searchResult['results'][1]['text']
print searchResult['results'][1]['attached_image']['url']
print searchResult['results'][1]['user_avatar']['i']

You can’t perform that action at this time.