Skip to content

Instantly share code, notes, and snippets.

@christiangenco
Created October 7, 2014 18:46
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiangenco/e8d085e47479be0131e1 to your computer and use it in GitHub Desktop.
Save christiangenco/e8d085e47479be0131e1 to your computer and use it in GitHub Desktop.
Impersonate your favorite HN commenter
require 'http'
require 'json'
require 'peach'
require 'gabbler'
require 'pry'
USERNAME = "patio11"
unless File.exists?("comments.txt")
def get_json(url)
json = HTTP.get(url).body
value = JSON.parse(json)
end
user = get_json("https://hacker-news.firebaseio.com/v0/user/#{USERNAME}.json")
submitted = user["submitted"]
File.open("comments.txt", 'a') do |f|
submitted.peach(10){|id|
comment = get_json("https://hacker-news.firebaseio.com/v0/item/#{id}.json")
f.puts comment["text"]
}
end
end
comments = File.read("comments.txt")
gabbler = Gabbler.new
gabbler.learn(comments)
10.times{
puts gabbler.sentence
puts
}
It is entirely independent from the captcha had a day reading XML files.
My app Paypal collects billing details, let them in, essentially, the same issue manually that I have left me unable to construct a model consider how much money they are launching to media attention and a failsafe in the other MOBA games are quirky in our industry it is necessarily a member of the enterprise, that body is much, much better feedback when someone says Why is this twaddle about Juliet?
Far more salient are negotiating skill, location, what company would profit from giving the sancrosanct assumption responsibility letter for it YES!
A nice set of challenges -- kitty at a school with tens of thousands of bucks a year or less immediately.
Signed, Named Person quot with the ugly alternative.
This is how the game is virtually no drama."
A domain name.
Teachers are not.
Knight just blew 400 million in sales last year and convince them to sign up for trying to get links.
If you think Victor will eventually get it almost lose me X00,000?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment