Giter VIP home page Giter VIP logo

news_aggregator's Introduction

NewsAggregator

This Project contain two main part; Reddit and News. I used rest-framework-django to build APIs.

I would clarify the two part as below.

1- reddit

Firstly, for testing the Reddit APIs, I made a Script app in Reddit. Also, for using Reddit APIs, I used Praw Package. Necessary Username, ClientID and Passwords for authorization is included in Praw.ini.

2- newsapi

For testing the News API, NewsAPIClient have been used which necessary Secret Key for authorization is included in venv/bin/activate which after activation of Virtual Environment would be exported as Environment Variable and I would obtain this secret key in setting.py file. Request method is โ€œgetโ€. News API is only following one function for calling and collecting news. If this function is out of query, would return all the news, but if there was a query, would search and collect all the news tagged as that query.

In this app, there are several Unit Test, examines situations such as redirect or assess the response.

In this unit test I send 500 requests to the server with diffrent words as parameter. because these apps in reddit and newsapi are testing apps it may get some errors such as "you are not allowed to send more than 500 in 12 hours". I add handle exception for these cases and also in this unit test I print duration of each request in app.log file for 50 requests.

For documentation of APIs, django-rest-swagger has been used that could be looked at /docs.

Follow these instructions for running application after cloning project

1- run below command (python3.6)
pip install -r requirements.txt
2-copy the below lines at the end of praw.ini, in praw packages that installed in $VIRTUALENV/lib/python3.6/site-packages
[user]
client_id=zmHMvdl7_V6jOg
client_secret=_-lUyJsY3c9Op0s-l_Ox2-DLz4o
password=asddsahadiz
username=hadizamani77
3-run below command in your terminal
export NEWS_API_SECRET_KEY="52ec1647432f4428ac6c80f23b1a3513"
4-run the server by manage.py

news_aggregator's People

Watchers

ali farid 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.