Giter Club home page Giter Club logo

miscellaneousdebris's Introduction

miscellaneousdebris

A mix bag of scripts and tools

scripts/bat

trend.py

Export BaT model page and associated listing information into a CSV and generate various charts

BaT Trend Example

  • Install (requires Python >= 3)
> git clone [email protected]:parachutemind/miscellaneousdebris.git
> cd miscellaneousdebris/scripts/bat
> pip install -r requirements.txt 
  • Usage:
python ./trend.py -h

E.g., Parse cts-v model page and follow listings, downloading them to a cache.

(py3) > python ./trend.py -u https://bringatrailer.com/cadillac/cts-v/
Downloaded https://bringatrailer.com/cadillac/cts-v/:/var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//cadillac/cts-v.html
Downloaded https://bringatrailer.com/listing/2012-cadillac-cts-v-2/:/var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//listing/2012-cadillac-cts-v-2.html
Downloaded https://bringatrailer.com/listing/2012-cadillac-cts-v-4/:/var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//listing/2012-cadillac-cts-v-4.html
....
Done: ./cts-v.csv

By default it waits 5 seconds before hitting the next BaT URL to be nice to their website.

Running the same command again, will read from cache instead of hitting BaT again:

(py3) > python ./trend.py -u https://bringatrailer.com/cadillac/cts-v/
Reading from cache /var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//cadillac/cts-v.html ...
Reading from cache /var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//listing/2012-cadillac-cts-v-2.html ...
Reading from cache /var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//listing/2012-cadillac-cts-v-4.html ...
Reading from cache /var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//listing/2011-cadillac-cts-v-5.html ...
Reading ....
Done: ./cts-v.csv

Don't follow listings (it will not get year, milage, and transmission information):

(py3) >  python ./trend.py -results-only -u https://bringatrailer.com/cadillac/cts-v 
Reading from cache /var/folders/qg/8qfb3sy12hq_jl3qhlnk43pc0000gn/T//cadillac/cts-v.html ...
Done: ./cts-v.csv

miscellaneousdebris's People

Contributors

parachutemind avatar

Watchers

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