Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created February 15, 2012 22:01
Show Gist options
  • Select an option

  • Save JakubOboza/1839307 to your computer and use it in GitHub Desktop.

Select an option

Save JakubOboza/1839307 to your computer and use it in GitHub Desktop.
usage: ./troll.rb <your@mail> <password> <from@mail>
sample output:
Kuba,
Kolejnośc preferowana
Bardzo fajny tutorial, wprowadzenie na początek:.
http://www.ocaml-tutorial.org/
Bardzo przystępnie napisana książka:
http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf
Super książka online (nie przeczytałem całości):
http://caml.inria.fr/pub/docs/oreilly-book/
Rozważ używanie GODI (manager pakietów od OCamla) i Batteries Included
(`nowa' standardowa biblioteka).
Jak potrzebujesz pomocy daj znać.
--spec
...
#!/usr/bin/env ruby
require 'gmail'
throw "Wojtek nie psuj" if ARGV.length < 3
username = ARGV[0]
password = ARGV[1]
from = ARGV[2]
Gmail.connect(username, password) do |gmail|
mails = gmail.inbox.emails(:read, :from => from)
mails.map{|mail| puts; puts mail.body}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment