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

JSON::ParserError on user(user_id).recent_media endpoint #4

Open
mdunnettstone opened this issue Feb 27, 2018 · 1 comment
Open

JSON::ParserError on user(user_id).recent_media endpoint #4

mdunnettstone opened this issue Feb 27, 2018 · 1 comment

Comments

@mdunnettstone
Copy link

user(user_id).recent_media endpoint results in JSON::ParserError for me.

Example code @instas = InstagramApi.user('testusername').recent_media

Error response is significant. Here's a taster - can share more if wanted.

784: unexpected token at ' <title> Page Not Found • Instagram </title> <script type="text/javascript"> (function() { var docElement = document.documentElement; var classRE = new RegExp('(^|\s)no-js(\s|$)'); var className = docElement.className; docElement.className = className.replace(classRE, '$1js$2'); })(); </script> <script type="text/javascript"> (function() { if ('PerformanceObserver' in window && 'PerformancePaintTiming' in window) { window.__bufferedPerformance = []; var ob = new PerformanceObserver(function(e) { window.__bufferedPerformance.push.apply(window.__bufferedPerformance,e.getEntries()); }); ob.observe({entryTypes:['paint']}); } })(); </script>

@SergeyMell
Copy link
Collaborator

SergeyMell commented Feb 28, 2018

Actually testusername is incorrect user ID. You should use numeric IDs for the requests.
As example, for my account

InstagramApi.user('serogamell').recent_media # incorrect usage

gives me the same error but

InstagramApi.user('4692075674').recent_media # correct usage

works ok.

I'll try to either implement a fix that will utilize string user IDs or implement a correct API response handling.

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