HnScraper
A gem for logging in and posting to Hacker News
Installation
Add this line to your application's Gemfile:
gem 'hn_scraper'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hn_scraper
Usage
cookie = HNScraper.get_login_cookie("username", "password")
puts cookie
if HNScraper.valid_hn_cookie?(cookie)
url = "https://github.com/hstove/hn-scraper"
title = "A Ruby Gem for Posting to Hacker News"
HNScraper.post_to_hn("username", "password", title, url)
link = HNScraper.newest_link
puts "Posted: #{link}"
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request