Yahoo doesn't provide an API to it's publicly available group info, so this gem covers that gap. Use it to find information about a Yahoo group such as name, description and relevant email addresses.
require 'yahoo-group-data' g = YahooGroupData.new("http://tech.groups.yahoo.com/group/OneStopCOBOL/") name = g.name description = g.description num_members = g.num_members p = g.post_email s = g.subscribe_email u = g.unsubscribe_email o = g.unsubscribe_email json = g.to_json
Available instance methods
These should be relatively self-explanatory. Where the data is unnavailable (for instance the group name if no group was found) the return value will be nil
- no_data? (true if any of the above are true, othersise false. Here for convenience)
- num_members (Integer)
- founded (Date)
It's tested with Ruby 1.9.3, it probably works with older versions.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install yahoo-group-data
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
pull requests with tests are more likely to be accepted
Rather than distribute a load of Yahoo's HTML pages with the gem there's a rake task to get the ones that are needed. Run:
$ rake fetch_yahoo_pages
$ rake test
Because of the dynamic nature of Yahoo groups it's quite possible that the number of members a group has in groups.yml will have diverged with the number of members in reality when you pull down the pages using "rake fetch_yahoo_pages". If you see any of these divergences just update groups.yml appropriately.
If you find a group the gem fails on
Tell me about it, or (in preference) update the gem (Hint: start by adding an entry to the groups.yml file), see contributing instructions above.
- Will Jessop (email@example.com)