designernews_api

Python API for Designer News.


Keywords
designer, news, designernews, api, designernews_api
License
Other
Install
pip install designernews_api==0.2

Documentation

Designernews API Build Status

Python API for Designer News. Inspired by the HackerNewsAPI

Install

Via pip (recommended)

pip install designernews_api

Or download from PyPi

Usage

See example.py

Class DN

The class DN parses the Designer News page, and builds up all stories.

Methods

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.

Available values in the story dict which is returned by get_stories()

  • 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
}

Contribute

New features, or improve existing ones? Send a pull request.

Tests

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.