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.
origen-react-instagram-feed
Advanced tools
Readme
Yes, react-instagram-feed
would be a better name but it was taken...
npm install --save origen-react-instagram-feed || yarn add origen-react-instagram-feed
Quick recipe for use with Material-UI
// @flow
import * as React from 'react';
import withInstagramFeed from 'origen-react-instagram-feed';
import { withStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import ButtonBase from '@material-ui/core/ButtonBase';
import compose from 'recompose/compose';
const styles = () => ({
wrapper: {},
image: {
width: '100%',
height: '100%',
},
});
export type Props = {
media?: Array<{
displayImage: string,
id?: string,
postLink?: string,
accessibilityCaption?: string,
}>,
account: string,
classes: { [$Keys<$Call<typeof styles>>]: string },
status: 'completed' | 'loading' | 'failed',
};
const InstaGrid = ({ classes, media, account, status}: Props) => {
return (
<Grid container spacing={32} className={classes.wrapper}>
{media &&
status === 'completed' &&
media.map(({ displayImage, id, postLink, accessibilityCaption }) => (
<Grid item xs={12} sm={6} md={4} key={id || displayImage}>
<ButtonBase
href={postLink || `https://www.instagram.com/${account}/`}
>
<img
src={displayImage}
alt={accessibilityCaption || 'Instagram picture'}
className={classes.image}
/>
</ButtonBase>
</Grid>
))}
{status === 'loading' && <p>loading...</p>}
{status === 'failed' && <p>Check instagram here</p>}
</Grid>
);
};
InstaGrid.defaultProps = {
media: undefined,
};
export default compose(
withInstagramFeed,
withStyles(styles),
)(InstaGrid);
//...
<InstaGrid account="origenstudio" numberOfMediaElements={9} />
//...
This is a HoC that injects instagram data as props. See supported props below:
Type: HOC<Base, Enhanced>
account
string account from where to get data from.numberOfMediaElements
number number of media elements to get. Max 12. (optional, default 12
)discardVideos
boolean discard videos from media elements. (optional, default false
)Returns any injects the data from getInstagramFeedInfo
to the props of the wrapped component.
This function returns a promise that when resolves return data extracted from the public profile page of an instagram account.
account
stringoptions
{numberOfMediaElements: number, discardVideos: boolean} (optional, default {numberOfMediaElements:12,discardVideos:false}
)Returns Promise<{accountInfo: any, accountFollowedBy: number, accountFollow: number, postsCount: number, profilePic: string, accountName: string, media: Array<{id: string, displayImage: string, thumbnail: string, likes: number, caption: string, commentsNumber: number, accessibilityCaption: string, dimensions: {width: number, height: number}, postLink: string}>}>
MIT © Origen Studio
Package generated using Nod
$ yarn test # run tests with Jest
$ yarn run coverage # run tests with coverage and open it on browser
$ yarn run lint # lint code
$ yarn run docs # generate docs
$ yarn run build # generate docs and transpile code
$ yarn run version patch|minor|major
$ yarn publish
It'll automatically run test
, lint
, docs
, build
, generate CHANGELOG.md
, and push commits and tags to the remote repository.
FAQs
Get the information from a public Instagram profile without need to access the API
The npm package origen-react-instagram-feed receives a total of 12 weekly downloads. As such, origen-react-instagram-feed popularity was classified as not popular.
We found that origen-react-instagram-feed 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.