DOC PREVIEW
UMD CMSC 330 - Ruby

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Blue lightsExample of a Bullet Point SlideSlide 3Slide 4Slide 5Slide 6Slide 7What YOU* need** to knowAbout how to munge*** Twitter feeds with Ruby*CMSC 330 Spring 2011**You don't actually need to know about Twitter, just pay attention to the Ruby.***Hideous colour scheme not included (blame Asad Sayeed).Text processing•Ruby: particularly suited for rapid construction of applications that process/produce data streams.• Twitter: an endless “garden hose” of a data stream• Several Ruby libraries written for rapid access to Twitter.– We'll use @SusanPotter's twitter4r libs.GJuliusC #Gallia est omnis divisa in partes 3, quarum 1 incolunt #Belgae, aliam #Aquitani, 3 qui ipsorum lingua #Celtae, nostra Galli appellantur.Installing Ruby libraries/'gems'•Ruby has an Linux-like package install tool.–We WON'T NEED this for most things.–DO NOT USE ON ANY PROJECT UNLESS WE SPECIFY OTHERWISE!!!12!!@!11!!!one!!!!• But if you want to follow along, log into linuxlab and type:gem install twitter4r•Will install a local copy of the twitter4r libs.• Library reference:–http://twitter4r.rubyforge.org/rdoc/Setting up•*If* you want to follow along on your laptop:–Make a dummy Twitter test account (I'll leave it to you to figure out how to do it, but “mailinator.com” may have a role to play...)• Create a config file on linuxlab, config.yamltest:login: SpartacusLives22password: donaferentes– Indent with spaces (it's a YAML file, another thing you don't need to know).•Ruby has lots of builtin libraries. (But we installed our own.)require('rubygems')gem('twitter4r', '0.6.0')require('twitter')• Connectingtwitter = Twitter::Client.from_config(ARGV[0])Starting off the codeLOL @ChanningTatum would never have survived north of the real #hadrianswall #gopictsAnd we're off!•Simple things to try–Download n tweets from arbitrary user–Smiley detection (mood classification?) with regexes•More complicated ones (vote?)– Construct @reply graph– Dijkstra's algorithm between two users (via @replies rather than friends?)– Build Twitter ELIZA!sternvestal im in urimperial #state pardoninur dudes. Remember 2 writecomments in ur code!#vestalvirgin #rubyMoral of the storyTWITTER IS JUST ANOTHER INPUT/OUTPUT STREAM!!!!!YOU CAN DO MAGIC WITH STREAMSIN A FEW LINES OF RUBY CODE(I STILL PREFER PYTHON. --


View Full Document

UMD CMSC 330 - Ruby

Documents in this Course
Exam #1

Exam #1

6 pages

Quiz #1

Quiz #1

2 pages

Midterm 2

Midterm 2

12 pages

Exam #2

Exam #2

7 pages

Ocaml

Ocaml

7 pages

Parsing

Parsing

38 pages

Threads

Threads

12 pages

Quiz #3

Quiz #3

2 pages

Threads

Threads

7 pages

Quiz #4

Quiz #4

2 pages

Exam #2

Exam #2

6 pages

Exam #1

Exam #1

6 pages

Threads

Threads

34 pages

Quiz #4

Quiz #4

2 pages

Threads

Threads

26 pages

Exam #2

Exam #2

9 pages

Exam #2

Exam #2

6 pages

Load more
Download Ruby
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ruby and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Ruby 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?