GithubHelp home page GithubHelp logo

awaemmanuel / amazon_deals_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aameer/amazon_deals_api

0.0 2.0 0.0 904 KB

The project is a working model of an API which can get deals from amazon (Gold box deals and Lightening deals)

License: MIT License

Python 76.63% JavaScript 23.37%

amazon_deals_api's Introduction

amazon_deals_api

The project is a working model of an API which can get deals from amazon ( both Gold box deals and Lightening deals) Requirements

  • python 2.7.4
  • django 1.5.4
  • beautifulsoup 3.2.1
  • django-cors-headers

Configration

Setup it just like a usual django project, just make sure you enter right location for saving the dump of lightenting deal data.

Some Important details

In this project we have used @csrf_exempt, you can use csrf based on your need. We are using django-cors-headers for this project, there are several other ways to implement CORS check this article for more details. The data dump for the lightening deals is taken with the help of the javascript snippet.To get the lates dump paste script_get_amazon_lightneing_deals.js present inside amazonparser/static/js/ in the cosole of link here (http://www.amazon.com/gp/goldbox)

To test if you have configured everything correctly, run the server python manage.py runserver and check the following links

Sample output Image deals

This link will give deals which we get from RSS feed present here

Sample output Image lightening deals

This link will give lightening deals which we get by js script and save in pickle format as lingtening_deals.pic

Hint for doing more with this API : you can also use ajax calls to get these reults, by consoling the results of ajax you can see all the information provided by the API in a cleaner format, Moreover the data for the get_deals call is up to date as we dynamically parse the RSS feed but for lightening deals which are handled seperately we have to update it on regular basis.Note that there is also a time stamp(viz. lightning_deals_timestamp_collected ) provided with each lightening deal item, which signifies when was the dump taken for that item, in addition to that deal time(viz. lightning_deals_product_deal_time) is also provided which tells us when the deal will end or start.So based on these two information tags for a particular item one can get the current status of the deal time.

Some Extra Optional Configration

For CORS we are allowing all the domains you can configure it to allow only specific domains for more details check django-cors-headers. I am not saving dumps in database but they can be saved if need arises.*

amazon_deals_api's People

Contributors

aameer avatar

Watchers

 avatar  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.