Python API for Designer News. Inspired by the HackerNewsAPI
Via pip (recommended)
pip install designernews_api
Or download from PyPi
See example.py
The class DN
parses the Designer News page, and builds up all stories.
get_stories()
- Returns a list of the top stories from the home page of Designer News.
get_stories(story_type='new')
- Returns a list of the most recent stories from the /new page of Designer News.
- rank - the rank of story on the page
- story_id - the story's id
- title - the title of the story
- is_self - no external link but article on designer news
- link - the url it points to (None for self posts)
- domain - the domain of the link (None for self posts)
- points - the points/karma on the story
- num_comments - the number of comments of the story
story = {
"rank": rank,
"story_id": story_id,
"title": title,
"link": link,
"domain": domain,
"points": points,
"num_comments": num_comments,
"is_self": is_self
}
New features, or improve existing ones? Send a pull request.
To run the tests locally just install the requirements by running pip install -r requirements.txt
.
Then run the command nosetests
in the command line from within the project's root directory.