will-t-harris / use-instagram-feed

React hook for scraping posts by user id
https://www.npmjs.com/package/use-instagram-feed
MIT License
5 stars 1 forks source link

use-instagram-feed

To install:

or

To use, pass the:

import {useInstagramFeed} from 'use-instagram-feed'

const App = () => {
  let photos = useInstagramFeed({
    userId: "10972317574",
    thumbnailWidth: 640,
    photoCount: 12,
  })

  return (
      <div>
      {photos &&
        photos.map(({ id, caption src, width, height, url }) => (
          <a key={id} href={url}>
            <img src={src} alt={caption} />
          </a>
        ))}
    </div>
  )
}

export default App

The hook returns each photo's id, caption text, photo source, photo width & height, and the post's URL