![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.
Grab some hidden in html data from social account page. Get social network IDs or screen names from links to social network accounts.
Sometimes you need to get a social network account name from a link. To store a screen name in your database instead of parsing the link every time, or maybe to work with these accounts using social network APIs (as I do). Would be easier to have a library that extracts this kind of information from all known social networks for your pleasure.
gem install ids_please
Or, put this in your Gemfile:
gem 'ids_please'
This gem works in two modes – you can get real data from social network by HTTP request and page parsing and you can just parse a link to social account to find username/id. Sometimes username from link can't be used with social network's API, in this case, try to get real ID with grab mode.
This functionality works through real HTTP requests, so if you feed it with many links – it can take a while.
As Facebook shows data only from public pages and public groups – in most cases you can't gather data from
any profile page. Same thing about private Instagram
accounts, profiles and private groups in vk
.
Also, you should provide real URLs with right protocols. For example, you will not receive any data from http://facebook.com/Microsoft
,
but from https://facebook.com/Microsoft
you'll receive all data as in example below:
ids = IdsPlease.new('https://instagram.com/microsoft/', 'https://facebook.com/Microsoft')
ids.grab
=> {:instagram=>
[IdsPlease::Grabbers::Instagram#70339427221180
@link=https://instagram.com/microsoft/,
@network_id=524549267,
@avatar=https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xpf1/t51.2885-19/10729318_654650964633655_619168277_a.jpg,
@display_name=Microsoft,
@username=microsoft,
@data={:bio=>"The official Instagram account of Microsoft. Celebrating people who break boundaries, achieve their goals, and #DoMore every day.", :website=>"http://msft.it/MSFTDoMore"}],
:facebook=>
[IdsPlease::Grabbers::Facebook#70339427168960
@link=https://facebook.com/Microsoft,
@network_id=20528438720,
@avatar=https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfa1/v/t1.0-1/394366_10151053222893721_1961351328_n.jpg?oh=f3efc47a669cf291221ca421eaf016fb&oe=55C61365&__gda__=1440162054_3bf920ed0b4c0c7873c4ec44affcec15,
@display_name=Microsoft,
@username=Microsoft,
@data={:type=>"company", :description=>"Welcome to the official Microsoft Facebook page, your source for news and conversation about..."}
]
}
insta = ids.grabbed[:instagram].first
insta.avatar
=> "https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xpf1/t51.2885-19/10729318_654650964633655_619168277_a.jpg"
Social networks supported for grabbing at the moment:
ids = IdsPlease.new('https://twitter.com/gazay', 'http://facebook.com/alexey.gaziev')
ids.parse
puts ids.parsed[:twitter] # => ["gazay"]
puts ids.parsed[:facebook] # => ["alexey.gaziev"]
puts ids.original # => ["https://twitter.com/gazay", "http://facebook.com/alexey.gaziev"]
Or you can just check that the link is for a known social network:
ids = IdsPlease.new('https://twitter.com/gazay', 'http://some-unknown-network.com/gazay')
ids.recognize
puts ids.recognized # => {:twitter=>[#<URI::HTTP:0x007fea3bba7e30 URL:http://twitter.com/gazay>]}
puts ids.unrecognized # => ["http://some-unknown-network.com/gazay"]
Social networks supported at the moment:
Special thanks to @ai, @yaroslav, @whitequark
Gem named under an impression of an awesome game called Papers, please.
Logo of gem also was inspired by its logo.
Thanks @dukope for allowing me to do this!
The MIT License
FAQs
Unknown package
We found that ids_please 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.