
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts. The API can be used to access any type of Instagram account but only provides read-access to basic data.
Add this line to your application's Gemfile:
gem 'insta-api'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install insta-api
Construct the Authorization Window URL below, replacing {app-id} with your Instagram app’s ID (from the App Dashboard > Products > Instagram > Basic Display > Instagram App ID field
), replacing {app-secret} with your Instagram app’s ID (from the App Dashboard > Products > Instagram > Basic Display > Instagram App Secret
) and {redirect-uri} with your website URL that you provided in Step 2 (Valid OAuth Redirect URIs
). The URL must be exactly the same.
> require 'insta'
> options = { redirect_uri: `redirect-uri`, client_id: `app-id`, client_secret: `app-secret` }
> client = Insta::Client.new(options)
> client.auth_url
# output:
# https://api.instagram.com/oauth/authorize?client_id=#{client_id}&redirect_uri=#{redirect_uri}&scope=#{scope}&response_type=code
Authenticate your Instagram user by signing into the Authorization Window, then click Authorize to grant your app access to your profile data. Upon success, the page will redirect you to the redirect URI you included in the previous step and append an Authorization Code. For example:
https://socialsizzle.herokuapp.com/auth/?code=AQDp3TtBQQ...#_
Note that #_
has been appended to the end of the redirect URI, but it is not part of the code
itself. Copy the code (without the #_
portion) so you can use it in the next step.
code => ....auth/?code=AQDp3TtBQQ...
#_
> client.access_token(code)
# output:
# {
# "access_token": "IGQVJ...",
# "user_id": 17841405793187218
# }
long-lived valid only 60day
> access_token = "IGQVJ..."
> client.long_lived_access_token(access_token)
# output:
# {
# "access_token": "{access-token}",
# "token_type": "{token-type}",
# "expires_in": {expires-in}
# }
> require 'insta'
> access_token = "IGQVJ..."
> client = Insta::API.new(access_token)
> client.me
> client.media
> # or
> client.media(25)
> # for pagination after above method call, run below method for getting next 25 media
> client.next_page
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that insta-api 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.