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

Sandbox Error or Bug? #36

Closed
ximhotep opened this issue Aug 27, 2016 · 9 comments
Closed

Sandbox Error or Bug? #36

ximhotep opened this issue Aug 27, 2016 · 9 comments

Comments

@ximhotep
Copy link

I'm trying to test the functionality of instaR inside the Sandbox and received the following error when trying to run most commands:

For example, Running getFollowers on one of my Sandbox users returns:
Error in content$data[[1]]$id : $ operator is invalid for atomic vectors

Running searchInstagram(tag="fall",token, n=10, folder="test") returns:
32 posts
Error in x[[field]] : subscript out of bounds

Is this a result of the Sandbox or is this a result of something else?

Thank you.
John

@amadeimatti
Copy link

John, I have the same problem...

@ghost
Copy link

ghost commented Sep 13, 2016

Hi, I seem to have the same problem.

When you're in sandbox mode (which is the default) you don't have any permissions at all.

By the way, you have to add a company name, email and link to privacy policy to even unlock the abiloty to put permissions under review.

screen shot 2016-09-13 at 12 35 01

If you try to start a submission (even for public_content), no matter what reason you provide, they shut you down. There're only a couple that works, yet, not having an official privacy policy makes it pretty stupid to send it for review anyway. They also demand things like screencast of your app, etc.

screen shot 2016-09-13 at 12 35 14

In other words, it seems like Instagram made their API connection unusable unless you want to officially launch a business or something like that.

I may be missing something, but both Facebook's and Instagram's are so limited and enclosed that you might as well just scrape that data.. it's a pity

@alanault
Copy link

Hi,

I have the same error (Error in x[[field]] : subscript out of bounds) - but do I have a token which is out of sandbox, so I suspect this isn't the issue. When I build the URL manually and then paste into a browser, then I get the correct API output, so it seems its a error in processing the output.

Looking through the code x[[field]] seems to happen in the unlistWithNA function, so it's possible the API output has changed slightly which has thrown this off.

Let me know if it would be useful to send example output etc as likely this is just a parsing issue

Best
Alan

@alanault
Copy link

Took a look through the source code - the issue seems to be in the searchListToDF funciton, which is trying to unlist the data to build a dataframe.

I suspect the API output was originally a nested list, which needed lots of parsing, however, now the content$data element is a dataframe, so the unlisting code falls over. By commenting out this step and just letting the dataframe flow through, I got a nice dataframe of posts back.

Two columns remain as lists ($tags and $users_in_photo'), both of which are ok for me as lists inside the dataframe.

For anyone else looking to make the same change, it's in getUserMedia line 76. I just commented this out and replaced with df <- content$data.

@pablobarbera
Copy link
Owner

@alanault Thanks so much for reporting this bug. Could you submit a pull request? Unfortunately I don't have access to a token out of sandbox anymore, so I cannot test this on my end. I'm probably going to take this package out of CRAN anyway, since it seems Instagram has been reluctant to approve apps for research purposes. (If you've had any success and would be willing to share your experience, either here or via email, I would also really appreciate it.)

darokun added a commit to darokun/instaR that referenced this issue Jan 11, 2017
"df <- content$data" instead of "df <- searchListToDF(content$data)" as per this post pablobarbera#36
@MicheleVNG
Copy link

Hi, I'm having the same problem as above, with a simple request:

> info <- getUser(username = MYUSERNAME, token = token)
Error in content$data[[1]]$id : $ operator is invalid for atomic vectors

Debugging the getUser() function I see that everything works up to line:

userid <- as.numeric(content$data[[1]]$id)

I think the [[1]] part is not necessary, in fact as.numeric(content$data$id) correctly returns the numeric ID.

Is this related to the Sandbox API account?

MicheleVNG added a commit to MicheleVNG/instaR that referenced this issue Mar 8, 2017
MicheleVNG added a commit to MicheleVNG/instaR that referenced this issue Mar 8, 2017
MicheleVNG added a commit to MicheleVNG/instaR that referenced this issue Mar 8, 2017
@jonneguyt
Copy link
Contributor

Have been playing around with it and indeed the response from the API has changed. This appears in more than just the ones that @MicheleVNG has edited. I don't know if I'll have any chance to come up with a thorough update anytime soon though.

@pensebien
Copy link

pensebien commented Oct 22, 2017

I was having the same problem but this time with data I gathered from Google Analytics using RGoogleAnalytics Package.
anytime(ga_data$date)
date | sessions
20170705 1403
20170706 403
20170707 1103
20170708 2403

@NabeelahB
Copy link

I am facing the same issue. I have a token which is in the sandbox mode. It is able to pull in data fine for getUserMedia for my account but gives subscript out of bounds error for getcomments. Any help would be appreciated

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

8 participants