New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

instagram-id-to-url-segment

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instagram-id-to-url-segment

Convert Instagram post IDs into Instagram links, algorithmically

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
562
decreased by-48.53%
Maintainers
1
Weekly downloads
 
Created
Source

Instagram Id To URL Segment

Build Status NPM version NPM license

Instagram has 2 types of IDs that they use for their posts. One is used in the URLs (it looks like 5n7dDmhTr3) and the other is used internally in their undocumented API (it looks like 1038059720608660215).

I didn't think that they would maintain 2 unrelated IDs for each post, just for the purpose of a shorter URL, so I investigated whether or not they were related. It turns out you can convert between them pretty easily (especially in languages where we don't represent integers as floats - like Python).

Usage

Note: the id must be passed in as a string. If it was passed as a number then it would be severely rounded.

CoffeeScript

{instagramIdToUrlSegment, urlSegmentToInstagramId} = require 'instagram-id-to-url-segment'
console.log(instagramIdToUrlSegment('1038059720608660215')) # 5n7dDmhTr3
console.log(urlSegmentToInstagramId('5n7dDmhTr3')) # 1038059720608660215

JavaScript

var ref, urlSegmentToInstagramId, instagramIdToUrlSegment;
ref = require('instagram-id-to-url-segment')
instagramIdToUrlSegment = ref.instagramIdToUrlSegment
urlSegmentToInstagramId = ref.urlSegmentToInstagramId;

console.log(instagramIdToUrlSegment('1038059720608660215')); // 5n7dDmhTr3
console.log(urlSegmentToInstagramId('5n7dDmhTr3')); // 1038059720608660215

Keywords

FAQs

Package last updated on 30 Jul 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc