rashil2000 / tfps

Website for Technology Filmmaking and Photography Society, IIT Kharagpur
http://www.tfps.iitkgp.ac.in
3 stars 3 forks source link

Instagram follower count does not work #2

Open chirag-ghosh opened 2 years ago

chirag-ghosh commented 2 years ago

This is a CORS error.

rashil2000 commented 2 years ago

Yeah, surprisingly it worked fine before. Not sure what those peeps at FB changed xD.

Will probably have to set some headers manually while executing fetch. Do you have a fix in mind? This is the relevant code line: https://github.com/rashil2000/tfps/blob/111cc920fd0cebbee4c3a49c9ee7674ff858b462/js/main.js#L240

chirag-ghosh commented 2 years ago

Yes instagram seems to have changed its CORS policy and is allowing only a limited urls. Reference The solution I see is to setup a proxy server or use some unofficial link (which acts as a cors proxy).

rashil2000 commented 2 years ago

We are not using a web server, it's just a static site. We might have to use an access token (like we do for Youtube subscriber count) and use the Instagram Graph API.