Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic username #76

Closed
eelkeh opened this issue Oct 17, 2019 · 4 comments
Closed

Dynamic username #76

eelkeh opened this issue Oct 17, 2019 · 4 comments

Comments

@eelkeh
Copy link

eelkeh commented Oct 17, 2019

In my case the username is dynamic, right now it pulls the username from the config. Is it possible to use a dynamic username based on a query?

@oorestisime
Copy link
Owner

This plugin like any of gatsby runs on build time so not sure what you mean by dynamic. You could retrieve the username from an environment variable but i guess what you are looking for is changing even after gatsby develop or gatsby build?

@eelkeh
Copy link
Author

eelkeh commented Oct 18, 2019

By dynamic I mean something like retrieving the username from a page query! So let's say for example sake I want to generate different pages (at build time) which include a bunch of instagram pictures from different accounts, one account per page.

@oorestisime
Copy link
Owner

Right so if you take a look at the example https://github.com/oorestisime/gatsby-source-instagram/blob/master/example/gatsby-config.js#L16-L46 you can see you can define this plugin multiple times. You can do one for each username until i find some time to do #22
Then in your page query you can do something like https://github.com/oorestisime/gatsby-source-instagram/blob/master/example/src/pages/scraping.js#L18 to retrieve only the posts of the username you wish.

Let me know if this is any help.

@oorestisime
Copy link
Owner

Closing this, if you think there's something to do in the plugin feel free to reopen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants