mvan231/Scriptable

Not able to check users with an underscore

Closed this issue · 8 comments

When trying to set the widget with a user that has an underscore, there's an error:
2022-01-20 09:44:59: Error on line 151:25: TypeError: undefined is not an object (evaluating 'json[0].user')

Where line 151 has url of username set to anything that has an underscore:
url = 'CNAC_GN' //'ps5uknews'

Is this for the Twitter widget? Or something else?

Is this for the Twitter widget? Or something else?

Yes, on the Twitter widget

Thanks for letting me know. I have tried multiple other Twitter accounts and they work fine with underscore at the beginning, middle, and end of the user handle. Something strange specific to this account is causing the issue. Do you see it on other accounts too?

Thanks for letting me know. I have tried multiple other Twitter accounts and they work fine with underscore at the beginning, middle, and end of the user handle. Something strange specific to this account is causing the issue. Do you see it on other accounts too?

So far, that's the only one I've found with that issue, strangely enough, that's the only one I want to check lol

I understand the issue. It's weird because the Twitter API responds with no data for that account. It's very strange

I've tried to escape the underscore with a few other characters but it just won't work

You are inputting it correctly, it's an issue with the account itself it seems. It's strange, because it's not a private account, so it should work

Understand what you mean. I think something strange with that account info is the issue. It might be possible to use the old method for building this widget (via webscraping) instead of the API