Extractors(:twitter).sanitize("http://twitter.com/#!/programmingshit")
Extractors(:twitter).sanitize("programmingshit")
... and format them back
Extractors(:twitter).format("programmingshit")
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
- :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.