Giter VIP home page Giter VIP logo

autobahn's Introduction

autobahn

automatic Hacker News front page output in terminal

Why

I wanted to have up to date HN information, and I noticed I was opening my terminal a lot. I used to have fortune readings in my terminal, but I figured it was better if I was able to read HN headlines.

This was made simply in bash so as to not require many dependencies. It also requires some tools found in *NIX including tr, jq, curl, sed (no longer need - thanks gabrielsroka), awk, echo and bash.

Installation

Clone autobahn

git clone https://github.com/realrasengan/autobahn

Copy autobahn.sh new location

cd autobahn
cp autobahn.sh ~/.autobahn.sh

Add to .bashrc

echo "bash ~/.autobahn.sh" >> .bashrc

Adding the script to crontab greatly increases the speed at which the script will run on terminal open.

crontab -l > .tmp.crontab.output
echo "*/10 * * * * ~/.autobahn.sh" >> .tmp.crontab.output
crontab .tmp.crontab.output
rm .tmp.crontab.output

You can also set the max # of stories to display (defaults at 10). For example, this will limit it to 5:

crontab -l > .tmp.crontab.output
echo "*/10 * * * * ~/.autobahn.sh 5" >> .tmp.crontab.output
crontab .tmp.crontab.output
rm .tmp.crontab.output

Then type source .bashrc

Created Files

The script will create 2 files on each run:

~/.autobahn.output ~/.autobahn.last

Sample Output

01) Stripe Capital <https://stripe.com/capital>
    166 points by jonknee | 1 hour ago | 63 comments: <https://news.ycombinator.com/item?id=20888817>
02) An Introduction to D3.js <https://wattenberger.com/blog/d3>
    231 points by slowhand09 | 2 hours ago | 36 comments: <https://news.ycombinator.com/item?id=20887708>
03) Debunking the Silly “Passive [Investing] Is a Bubble” Myth <https://awealthofcommonsense.com/2019/09/debunking-the-silly-passive-is-a-bubble-myth/>
    208 points by sharkbot | 2 hours ago | 122 comments: <https://news.ycombinator.com/item?id=20887641>
04) Don’t force allocations on the callers of your API <https://dave.cheney.net/2019/09/05/dont-force-allocations-on-the-callers-of-your-api>
    44 points by robfig | 1 hour ago | 23 comments: <https://news.ycombinator.com/item?id=20888238>
05) WeWork Parent Weighs Slashing Its Valuation in Half <https://www.wsj.com/articles/wework-parent-weighs-slashing-its-valuation-roughly-in-half-11567689174?mod=rsswn>
    215 points by jason_zig | 5 hours ago | 158 comments: <https://news.ycombinator.com/item?id=20886315>

Get all news at https://news.ycombinator.com/

Deletion

Remove from .bashrc

Remove from crontab

Remove files with prefix ~/.autobahn.*

Alternate Implementations

Those alternate implementations do not implement everything that full script does, in particular they do not cache the data, so they are unusable for includision in your .bashrc (unless you are very patient...)

hn.py - in Python 3.6 + and the requests module

hn.ps1 - in MS PowerShell by gabrielsroka

hn.sh - in Bash, minimal implementation

License

Copyright (c) 2019 Andrew Lee (MIT License)

Copyright (c) 2019 github.com/realrasengan/autobahn Contributors (MIT License)

autobahn's People

Contributors

alkhatib avatar gabrielsroka avatar ircventures avatar realrasengan avatar theamk 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.