Project

tweet_url

0.0
No commit activity in last 3 years
No release in over 3 years
Extract username and status_id from tweet URL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
>= 0
 Project Readme

TweetUrl

Build Status Gem Version

Installation

Add this line to your application's Gemfile:

gem 'tweet_url'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tweet_url

Usage

Simply,

require 'tweet_url'

tweet_url = TweetUrl.parse('https://twitter.com/jack/status/761304654147784704/photo/1')
tweet_url.username  #=> "jack"
tweet_url.status_id  #=> 761304654147784704

To handle URL containing multibyte chars, run gem install addressable and

require 'addressable/uri'
require 'tweet_url'

tweet_url = TweetUrl.parse(
  'https://twitter.com/yukihiro_matz/status/755950562227605504#尾骶骨',
  parser: Addressable::URI)
tweet_url.username  #=> "yukihiro_matz"
tweet_url.status_id  #=> 755950562227605504