Code Monkey home page Code Monkey logo

hn's Introduction

hn

An easy-to-use CLI and Python library for HNSearch's API.

Installation

There are two ways of installing the library:

pip install hn

Alternatively, run the following from the command line:

python setup.py install

CLI

Usage patterns for working with the hn CLI.

Search

Basic search terms and querying. Allows for specifying number of results with n flag (maximum is 100), and starting ordinal position of results with the s flag.

hn term
hn multiple terms -n 100
hn multiple terms -n 100 -s 100

Date

The d flag allows for searchs filtered to a specific date (in YYYY-MM-DD or MM-DD-YY format).

hn -d 03-16-12
hn -d 2012-03-16

hn github -d 2012-03-16
hn techcrunch -d 03-16-12

Hits

Return the number of results encountered with the --hits flag.

hn pg --hits
hn zachwill --hits

Sorting

By default, sorting will be descending (though both asc and desc can be used).

hn github -S points
hn github -S username desc
hn -d 03-16-12 -S username asc -n 100

Time

In addition to filtering by date creation, you can specify the hours to search within on the specific day.

hn -d 03-16-12 -t 0 12
hn -d 03-16-12 -t 13 23

hn -d 03-16-12 -t 12am 12pm
hn -d 03-16-12 -t 1pm 11pm

Type

The T flag allows filtering by specific types of items (comment or submission).

hn zachwill -T comment
hn zachwill -T submission -S points -n 100

Username

The u or U flags allows filtering by a specific username.

hn -U zachwill
hn ycombinator -U pg

hn -U pg -T submission -S points
hn -U pg -T comment -S points asc

hn's People

Contributors

zachwill avatar

Stargazers

 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.