No commit activity in last 3 years
No release in over 3 years
Twitter Web Intent URLs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10
= 3.0.0beta2

Runtime

 Project Readme

Twitter Web Intents Ruby Gem

Gem Version Build Status Dependency Status Coverage Status

Twitter Web Intents provides simple helper methods that return Twitter Web Intent URLs. The parameters that are passed are verified to ensure they are valid.

You can read more about Twitter Web Intents on Twitter's site: https://dev.twitter.com/docs/intents

Installation

Add this line to your application's Gemfile:

gem 'twitter_web_intents'

And then execute:

$ bundle

Or install it yourself as:

$ gem install twitter_web_intents

Note: You must be using Ruby 1.9.3 or later to use this gem due to the ActiveSupport dependency.

Methods

get_search_url(query)

TwitterWebIntents.get_search_url('Parmigiano-Reggiano')
#=> "https://twitter.com/search?q=Parmigiano-Reggiano"

get_profile_url(screen_name)

TwitterWebIntents.get_profile_url('warblealerts')
#=> "https://twitter.com/warblealerts

get_status_url(screen_name, user_id)

TwitterWebIntents.get_status_url('warblealerts', 318705541666988034)
#=> "https://twitter.com/warblealerts/status/318705541666988034"

get_user_url(params)

Valid parameters: [:screen_name, :user_id]

TwitterWebIntents.get_user_url({:screen_name => 'warblealerts'})
#=> "https://twitter.com/intent/user?screen_name=warblealerts"

OR

TwitterWebIntents.get_user_url({:user_id => 102})
#=> https://twitter.com/intent/user/?user_id=102

get_favorite_url(params)

Valid parameters: [:tweet_id, :related]

TwitterWebIntents.get_favorite_url({:tweet_id => 318705541666988034, :related => ['warblealerts','richhollis']})
#=> "https://twitter.com/intent/favorite?related=warblealerts%2Crichhollis&tweet_id=318705541666988034"

get_tweet_url(params)

Valid parameters: [:url, :via, :text, :in_reply_to, :hashtags, :related]

TwitterWebIntents.get_tweet_url({:url => 'http://warble.co', :via => 'richhollis', :text => 'hello world', :in_reply_to => 318705541666988034, :hashtags => '#warble', :related => 'warblealerts'})
#=> "https://twitter.com/intent/tweet?hashtags=%23warble&in_reply_to=318705541666988034&related=warblealerts&text=hello+world&url=http%3A%2F%2Fwarble.co&via=richhollis"

get_retweet_url(params)

Valid parameters: [:tweet_id, :related]

TwitterWebIntents.get_retweet_url({:tweet_id => 318705541666988034, :related => ['warblealerts','richhollis']})
#=> "https://twitter.com/intent/retweet?related=warblealerts%2Crichhollis&tweet_id=318705541666988034"

Contributing

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