stevenschobert / instafeed.js

A simple Instagram JavaScript plugin for your website
https://instafeedjs.com
MIT License
3.51k stars 859 forks source link

Integration with igfeed-proxy #717

Closed Faylixe closed 2 years ago

Faylixe commented 3 years ago

Hello and thanks for your project which is great !

I have been pretty inspired by your library and I came up with an alternative for token and data proxing that may be nice to integrate in this project : https://github.com/Faylixe/igfeed-proxy.

The idea is to provide a service running on a free Heroku dyno to replace the instagram token agent, by actually performing the Instagram API call from the service it self and caching the fetched data in memory. It avoid exposing the access token to the client, any form of rate limiting since it only fetch data at a fixed interval and caching. Plus the application also ping itself at fixed interval to prevent from dyno idling without having to setup any external service or tweak :).

I was wondering if integrating this kind of service directly with Instafeed would be ok for you by offering user the possibility to either use the old model (based on token agent and direct IG API querying) and this one by simply providing a proxy URL to fetch directly data from it). If you are interrested please let me know and I will submit a PR for it.

Chinoman10 commented 3 years ago

I'm pretty sure that Steven stopped doing development altogether. Just look at his commit activity. My solution instead of a Heroku worker was using CF Workers :) No need to have a constant server running waiting for requests, and using KV storage I can also cache the results.

stevenschobert commented 3 years ago

@Chinoman10 if you’re referring to the commit graph that GitHub shows on profile pages — those only show commits in public repositories.

Chinoman10 commented 3 years ago

@Chinoman10 if you’re referring to the commit graph that GitHub shows on profile pages — those only show commits in public repositories.

Ah. Makes sense. Fair point! 😬 Apologies for the snarky comment then 🧐 🍻

stevenschobert commented 3 years ago

Hey @Faylixe! Thanks for sharing your project!

I was wondering if integrating this kind of service directly with Instafeed would be ok for you by offering user the possibility to either use the old model (based on token agent and direct IG API querying) and this one by simply providing a proxy URL to fetch directly data from it)

This would be great, and something I'd be happy to have a PR created for!

The URL construction is currently in lines 201-212: https://github.com/stevenschobert/instafeed.js/blob/bc3c109abe088a322b97eb530d5613c1a1642a2d/src/instafeed.js#L201-L212

I'd like to have this code lifting out into its own method, and add options around it. Possible options worth adding are:

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had new comments in the last 3 months. It will be closed if no further activity occurs. If you still need assistance with this issue, or believe it shouldn't be closed, please respond with a new comment to let us know. Thank you all for your contributions.