![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Parse social media attributes from url or construct url from attributes.
[:facebook, :github, :instagram, :github, :google, :linkedin, :medium, :pinterest, :qiita, :twitter, :vimeo, :youtube]
Add this line to your application's Gemfile:
gem 'social_parser'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install social_parser
The following code is an example of Twitter.
parser = SocialParser.parse 'https://www.twitter.com/hyde141421356'
=> #<SocialParser::Provider::Twitter:0x007fc57720a690 @url="https://www.twitter.com/hyde141421356">
parser.username
=> 'hyde141421356'
parser.provider
=> :twitter
parser.url
=> 'https://www.twitter.com/hyde141421356'
Facebook, Google+, LinkedIn, etc... as well.
parser = SocialParser.parse 'https://github.com/hyde2able'
=> #<SocialParser::Provider::Github:0x007fc5771e3c98 @url="https://github.com/hyde2able">
parser.username
=> 'hyde2able'
parser.provider
=> :github
parser.url
=> 'https://github.com/hyde2able'
An example of Youtube.
parser = SocialParser.parse 'https://www.youtube.com/watch?v=WOvdMz4yM9U'
=> #<SocialParser::Provider::Youtube:0x007faa5e26fd58 @url="https://www.youtube.com/watch?v=WOvdMz4yM9U", @type="video">
parser.id # alias parser.username
=> 'WOvdMz4yM9U'
parser.embed_url
=> 'https://www.youtube.com/embed/WOvdMz4yM9U'
When an embedded URL is not provided
parser = SocialParser.parse 'https://github.com/hyde2able'
=> #<SocialParser::Provider::Github:0x007faa5e06d7a8 @url="https://github.com/hyde2able">
parser.embed_url
# SocialParser::InvalidURIError: SocialParser::InvalidURIError
Excute this code
bundle exec rspec
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that social_parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.