0.0
No commit activity in last 3 years
No release in over 3 years
A client library for Team Error404's Nanotwitter in Cosi 105b
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

NanoTwitter Gem

A Gem for Team Error404's NanoTwitter API in Cosi 105b at Brandeis University

Getting Started

To install NanoTwitter run this in your terminal

gem install nanotwitter

and in the top of your file that will use the gem require:

require 'nanotwitter'

and you are all set!

Using the Gem

Initialize

To initialize an instance of NanoTwitter:

client = NanoTwitter.new("<NanoTwitter UserName>","<API Token>")

Users

NanoTwitter returns users as User objects:

user.name #=> returns the user's name
user.id #=> returns the user's id
user.tweets #=> return a list of tweet objects that the user posted
user.timeline #=> returns a list of the tweets on the user's timeline

Tweets

NanoTwitter will return tweets as Tweet objects:

tweet.text #=> returns the text of a tweet
tweet.poster #=> returns the name of the user who posted the tweet
tweet.user #=> gives access to the user who posted the tweet.  note: not ever call returns a user

Get User

Returns a User object representing the user's information that initialized the client:

client.get_user

Get Home Timeline

Returns the home timeline of NanoTwitter as a list of Tweet objects, with an optional parameter of n recent tweets:

client.get_timeline(number)

Get user Timeline

Returns the timeline of the user initializing the client, with an optional parameter of n recent tweets:

client.get_user_timeline(number)

Post Tweet

Posts and returns a tweet on the user's account that initialized the client:

client.post_tweet("text")

Search Tweets

Returns a list of tweet objects whose text includes the search term:

client.search_tweets("search term")

Search Users

Returns a list of user objects whose name includes the search term:

client.search_users("search term")