GithubHelp home page GithubHelp logo

jvimedia / newspaper-delivery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voidfiles/newspaper-delivery

0.0 1.0 0.0 56.23 MB

A heroku app that exposes features from https://github.com/codelucas/newspaper/ as json API

newspaper-delivery's Introduction

Newspaper Delivery

newspaper is a python based article extraction framework. It can produce pocket-like results. While it is very easy to use as a python library, I thought it would be interesting to turn this into a hosted app. Its all setup to be heroku app.

Installation

git clone https://github.com/voidfiles/newspaper-delivery.git
cd newspaper-delivery
virtualenv --no-site-packages venv
source venv/bin/activate
pip install -r requirements.txt
python app.py

You should now have a local version of the app running at http://127.0.0.1:5000/

User

You can now try it out there are two main endpoints. First is the /article endpoint. This works with newspapers article extraction.

curl http://localhost:5000/article?url=http://www.macdrifter.com/2014/01/list-of-natural-language-apis-link.html

Will produce something like this

{
    "additional_data": {},
    "authors": [],
    "canonical_link": "http://www.macdrifter.com/2014/01/list-of-natural-language-apis-link.html",
    "images": [
        "http://www.macdrifter.com/theme/images/logo.svg",
        ...
    ],
    "keywords": [
        "rundown",
		...
    ],
    "meta_description": "",
    "meta_favicon": "/theme/images/touch-icon-iphone.png",
    "meta_keywords": [
        ""
    ],
    "meta_lang": "en",
    "movies": [],
    "summary": [],
    "tags": [
        "Programming",
        "Link"
    ],
    "text": "This is a nice rundown of some natural language APIs.\n\nThe source is Mashape which looks like an API middleman. It's an interesting idea and their index looks very good and it's searchable.\n\nDon't miss the link at the bottom for PublicAPI.com, which I've seen before but always forget about.",
    "title": "List of Natural Language APIs [Link]",
    "top_image": "/theme/images/favicon.png",
    "url": "http://www.macdrifter.com/2014/01/list-of-natural-language-apis-link.html"
}

Lastly is the /source endpoint. Which is synonmous with the main interface of newspaper.

curl http://localhost:5000/source?url=http://cnn.com

Will produce something like this

{
    "articles": [
        "http://www.cnn.com/2012/04/04/opinion/colb-strip-search/index.html",
        "http://ac360.blogs.cnn.com/2013/12/03/pick-your-favorite-ridiculist-of-2013/",
        "http://piersmorgan.blogs.cnn.com/2013/11/08/william-shatner-on-obamacare-ponder-the-mystery/",
        ...
    ],
    "brand": "cnn",
    "categories": [
        "http://cnn.com",
        "http://cnn.com/HLN",
        "https://portfolio.money.cnn.com",
        "http://ireport.cnn.com",
        ...
    ],
    "description": "CNN.com delivers the latest breaking news and information on the latest top stories, weather, business, entertainment, politics, and more. For in-depth coverage, CNN.com provides special reports, video, audio, photo galleries, and interactive guides.",
    "domain": "cnn.com",
    "favicon": "",
    "feeds": [
        "http://rss.cnn.com/rss/cnn_tech.rss",
        ...
    ],
    "logo_url": ""
}

newspaper-delivery's People

Contributors

tomtaylor avatar voidfiles avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.