hn-go is a restful hacker news api & story data consolidator using gin framework
- Install the package
go get -v -u github.com/aacanakin/hn-go
- Install httpie // for cronjobs
sudo apt-get install httpie
-
Make the configuration
In the config.toml
file, there exists various configuration options. Just change them according to your configuration.
- Run the server
go run app.go
- Run the jobs // schedule these jobs in crontab
sh crons.sh
- GET /stories/:type
Description: Returns the stories in json format of github.com/aacanakin/hn
- PUT /stories/:type
Description: Retrieves the stories and saves it to db
Type could be the following;
- new
- top
- job
- ask
- show