Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Extract user accounts from different urls: tumblr, facebook and others
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
specs
.gitignore
Gemfile
README.markdown
Rakefile
extractors.gemspec

README.markdown

Extract user accounts from different contexts...

Extractors(:twitter).sanitize("http://twitter.com/#!/programmingshit") # => "programmingshit"
Extractors(:twitter).sanitize("programmingshit") # => "programmingshit"

... and format them back

Extractors(:twitter).format("programmingshit") # => "http://twitter.com/#!/programmingshit"

Add your own extractors

Extractors.add :lookatme do
  username_regexp = '[a-zA-Z0-9_\\-]{3,20}'
  sanitizer [
    %r{^(?:http://)?(?:www\.)?lookatme\.ru/users/(#{username_regexp})},
    %r{^(#{username_regexp})$}
  ]
  formatter 'http://lookatme.ru/users/%s'
end

List of available extractors

  • :facebook
  • :googleplus
  • :gtalk
  • :lastfm
  • :livejournal
  • :lookatme
  • :moikrug
  • :myspace
  • :skype
  • :tumblr
  • :twitter
  • :vkontakte
  • :youtube

Credits

The code itself has been extracted from http://github.com/toy/contacts gem.

Something went wrong with that request. Please try again.