Project

gnip_gnop

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby library that given a Gnip activity stream XML <entry>, will allow you to interact with that entry as a first-class Ruby object.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

GnipGnop

A ruby library that given a Gnip activity stream XML , will allow you to interact with that entry as a first-class Ruby object.

Installation

Add this line to your application's Gemfile:

gem 'gnip_gnop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gnip_gnop

Usage

The library assumes that you have a well formed activity stream entry element (generally chunked in via a Gnip stream). You can then parse that xml element like this:

> entry = GnipGnop::Entry.parse(xml)

Given this object reference, you can then "walk" the XML object's hierarchy.

> entry.id
 => "tag:search.twitter.com,2005:180761363340197888"

Or, a more complex example:

> entry.author.name
 => "greeneyedtengu"

Where there were namespace conflicts (for example there is an element as well as a namespaced author element, e.g. activity:author, in which cases I camelcased the accessor.

So for example the activity author has an id, which can be accessed like:

> entry.activity_author.id
 => "http://twitter.com/greeneyedtengu"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request