https://github.com/aayush26/pirant
devRant API wrapper in Python
https://github.com/aayush26/pirant
api-wrapper devrant python
Last synced: 5 months ago
JSON representation
devRant API wrapper in Python
- Host: GitHub
- URL: https://github.com/aayush26/pirant
- Owner: aayush26
- License: mit
- Created: 2017-09-23T21:35:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-26T17:59:16.000Z (over 7 years ago)
- Last Synced: 2024-11-08T21:19:21.972Z (5 months ago)
- Topics: api-wrapper, devrant, python
- Language: Python
- Size: 61.5 KB
- Stars: 17
- Watchers: 6
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-devrant - pirant - A Python wrapper for the devRant API (Uncategorized / Uncategorized)
README
# pirant
[](https://travis-ci.org/aayush26/pirant)
[](http://pirant.readthedocs.io/en/latest/?badge=latest)
[](https://coveralls.io/github/aayush26/pirant?branch=master)
[](https://pypi.python.org/pypi/pirant)
[](https://pypi.python.org/pypi/pirant)
[](https://github.com/aayush26/pirant/graphs/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']```