Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
nanogram.js
Advanced tools
Readme
Key Features • Demo • Documentation • Installation • How To Use • Caveats • Browsers support • License • Contributing
You can read the full documentation here
$ npm install nanogram.js --save
$ yarn add nanogram.js
Add script right before closing </body>
tag
<script src="https://unpkg.com/nanogram.js@3.0.3/dist/nanogram.iife.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/nanogram.js@3.0.3/dist/nanogram.iife.js"></script>
Hint: for a better performance add preconnect link in the head of your document.
<head>
<!-- for unkpg cdn -->
<link rel="preconnect" href="https://unpkg.com">
<!-- for jsdelivr cdn -->
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<!-- dns-prefetch only for IE11 -->
<!-- <link rel="dns-prefetch" href="https://unpkg.com"> -->
<!-- <link rel="dns-prefetch" href="https://cdn.jsdelivr.net"> -->
</head>
import { getMediaByUsername } from 'nanogram.js'
getMediaByUsername('instagram').then((media) => {
console.log(media);
});
const getMediaByUsername = require('nanogram.js').getMediaByUsername;
getMediaByUsername('instagram').then((media) => {
console.log(media);
});
const getMediaByUsername = window.Nanogram.getMediaByUsername
getMediaByUsername('instagram').then((media) => {
console.log(media);
});
Note: get content from user page. 12 photos is the maximum for this method.
import { getMediaByPostId } from 'nanogram.js'
getMediaByPostId('CIrIDMtDwn4').then((media) => {
console.log(media);
});
const getMediaByPostId = require('nanogram.js').getMediaByPostId;
getMediaByPostId('CIrIDMtDwn4').then((media) => {
console.log(media);
});
const getMediaByPostId = window.Nanogram.getMediaByPostId
getMediaByPostId('CIrIDMtDwn4').then((media) => {
console.log(media);
});
Note: get content from post page
import { getMediaByReelId } from 'nanogram.js'
getMediaByReelId('CKONdDkJaPU').then((media) => {
console.log(media);
});
const getMediaByReelId = require('nanogram.js').getMediaByReelId;
getMediaByReelId('CKONdDkJaPU').then((media) => {
console.log(media);
});
const getMediaByReelId = window.Nanogram.getMediaByReelId
getMediaByReelId('CKONdDkJaPU').then((media) => {
console.log(media);
});
Note: get content from reel page
import { getMediaByTag } from 'nanogram.js'
getMediaByTag('sunset').then((media) => {
console.log(media);
});
const getMediaByTag = require('nanogram.js').getMediaByTag;
getMediaByTag('sunset').then((media) => {
console.log(media);
});
const getMediaByTag = window.Nanogram.getMediaByTag
getMediaByTag('sunset').then((media) => {
console.log(media);
});
Note: get content from tag page
import { getMediaByLocation } from 'nanogram.js'
getMediaByLocation(6264386, 'highbridge-park').then((media) => {
console.log(media);
});
const getMediaByLocation = require('nanogram.js').getMediaByLocation;
getMediaByLocation(6264386, 'highbridge-park').then((media) => {
console.log(media);
});
const getMediaByLocation = window.Nanogram.getMediaByLocation
getMediaByLocation(6264386, 'highbridge-park').then((media) => {
console.log(media);
});
Note: get content from location page
import { getCountries } from 'nanogram.js'
getCountries().then((media) => {
console.log(media);
});
const getCountries = require('nanogram.js').getCountries;
getCountries().then((media) => {
console.log(media);
});
const getCountries = window.Nanogram.getCountries
getCountries().then((media) => {
console.log(media);
});
Note: get countries from location page
import { getCitiesByCountryId } from 'nanogram.js'
getCitiesByCountryId('US').then((media) => {
console.log(media);
});
const getCitiesByCountryId = require('nanogram.js').getCitiesByCountryId;
getCitiesByCountryId('US').then((media) => {
console.log(media);
});
const getCitiesByCountryId = window.Nanogram.getCitiesByCountryId
getCitiesByCountryId('US').then((media) => {
console.log(media);
});
Note: get cities from country page
import { getPlacesByCityId } from 'nanogram.js'
getPlacesByCityId('c2728325').then((media) => {
console.log(media);
});
const getPlacesByCityId = require('nanogram.js').getPlacesByCityId;
getPlacesByCityId('c2728325').then((media) => {
console.log(media);
});
const getPlacesByCityId = window.Nanogram.getPlacesByCityId
getPlacesByCityId('c2728325').then((media) => {
console.log(media);
});
Note: get places from city page
import { getMediaByPlaceId } from 'nanogram.js'
getMediaByPlaceId(2999512).then((media) => {
console.log(media);
});
const getMediaByPlaceId = require('nanogram.js').getMediaByPlaceId;
getMediaByPlaceId(2999512).then((media) => {
console.log(media);
});
const getMediaByPlaceId = window.Nanogram.getMediaByPlaceId
getMediaByPlaceId(2999512).then((media) => {
console.log(media);
});
Note: get content from place page
import { getMediaBySearchQuery } from 'nanogram.js'
getMediaBySearchQuery('sunset').then((media) => {
console.log(media);
});
const getMediaBySearchQuery = require('nanogram.js').getMediaBySearchQuery;
getMediaBySearchQuery('sunset').then((media) => {
console.log(media);
});
const getMediaBySearchQuery = window.Nanogram.getMediaBySearchQuery
getMediaBySearchQuery('sunset').then((media) => {
console.log(media);
});
Note: get content from searchbar on the top of the page
IE / Edge | Firefox | Chrome | Safari | iOS Safari | Opera | Yandex |
---|---|---|---|---|---|---|
IE11*, Edge 12+ | 27+ | 32+ | 7.1+ | 8+ | 19+ | 14.2+ |
*
– For IE11 you need to install a Promise polyfill.
If you are using version less than 2.0.0 you will also need polyfill for Fetch API.
If you want maximum browser compatibility, please use polyfills.
See caniuse for promise.
If you want to send a polyfill only to browsers that need it, there's a handy service called Polyfill.io which does just that, it offers a wide array of polyfills.
Here's an example of using polyfill.io to polyfill only the Promise
feature, so if we put this right before closing </body>
tag of index.html
and Nanogram.js
script, Polyfill.io will read the user agent and use that information to determine if the browser requires a polyfill for the feature or features listed. Since I'm using Chrome it will send back an empty response since my browser doesn't need it, pretty slick.
<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise"></script>
Alternatively, you can install packages like es6-promise.
Node.js doesn't have a built-in implementation of the XHR API
, but you can use any library with a compatible interface, such xmlhttprequest.
If you are using version less than 2.0.0 you need Fetch API
instead of XHR API
. Such node-fetch.
Found a bug? Missing a specific feature? Your contributions are always welcome! Please have a look at the contribution guidelines first.
Thanks goes to these wonderful people (emoji key):
Alexey Istomin 🚇 💻 🤔 | Yousuf Khan 💻 ⚠️ 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
An easy-to-use and simple Instagram package allows you to fetch media content without API and access token.
The npm package nanogram.js receives a total of 214 weekly downloads. As such, nanogram.js popularity was classified as not popular.
We found that nanogram.js 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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.