paulfp / social-media-counter

A Raspberry Pi-based social media follower counter, cycling through Facebook, Twitter, Instagram and YouTube accounts with follower counts displayed on a colour LED display.
GNU General Public License v3.0
16 stars 4 forks source link

Instagram no longer provides follower count #1

Open GFBsoul opened 4 years ago

GFBsoul commented 4 years ago

Instagram no longer lists follower count in the url that social media counter parses. I think we need a new approach. This should be possible with the Facebook developer credentials. I'm not a coder, so I'm afraid I can't provide any solution.

paulfp commented 4 years ago

Ah yes you're right, it's a shame! I'm planning to pick this project up again later this year so will try to find a new solution. I'm not confident about the Facebook approach though because they have to approve API access for the app (and they refused for this one previously) just to view a follower count for a page, which seems crazy to me as it's hardly private info.

GFBsoul commented 4 years ago

I'm glad you are picking the project up again! I might not be able to code the thing, but I can always help out to try and find a good source for the data. I'm also in the process of getting something approved through Facebook developers. But it seems like way too much work for a project like. You would like to get this thing up and running within a day.

fenau88 commented 4 years ago

i saw that the code is under "userInteractionCount" in the sourcecode of the page i hope this helps

fenau88 commented 4 years ago

We found a solution, change this with the complett instagram part, not the best solution but it works

// Get Instagram followers if(!is_null($instagramUsername)) { $url = 'https://www.instagram.com/' . $instagramUsername; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $output = curl_exec($ch);

preg_match('/userInteractionCount\"\:\"(.*?)\"/', $output, $followerCount);
$instagramFollowers=$followerCount[1];

}