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

TitleReader and Instagram #23

Open
dentarg opened this issue Jan 18, 2016 · 3 comments
Open

TitleReader and Instagram #23

dentarg opened this issue Jan 18, 2016 · 3 comments

Comments

@dentarg
Copy link
Owner

dentarg commented Jan 18, 2016

This is of no help:

08:17:53 <.... spuun> https://www.instagram.com/p/BAqirNbwEc0/
08:17:54 <. rufwebot> Instagram

This would be great:

elonmusk: Falcon lands on droneship, but the lockout collet doesn't latch on one the four legs, causing it to tip over post landing. Root cause may have been ice buildup due to condensation from heavy fog at liftoff.

@dentarg
Copy link
Owner Author

dentarg commented Jun 24, 2016

Instagram has severley limited what API clients can do, needing explicit permission from users, even to get public content, if I understand things correctly (https://www.instagram.com/developer/authorization/, https://www.instagram.com/developer/review/).

Possible solution though, https://www.instagram.com/<user>/media returns nice JSON (e.g. https://www.instagram.com/instagram/media). In that JSON, we could look for the caption belonging to the photo. We have the code from the URL posted (https://www.instagram.com/p/<code>/, but we also need to get the username. We could extract the username from <meta content="See this Instagram video by @elonmusk • 62.4k likes" name="description" /> on the photo page.

@dentarg
Copy link
Owner Author

dentarg commented Nov 11, 2017

https://www.instagram.com//media returns nice JSON

No more, now 404

@dentarg
Copy link
Owner Author

dentarg commented Nov 11, 2017

Also, Instagram (tested https://www.instagram.com/p/BAqirNbwEc0/) now triggers exception:

argh <TitleReaderPlugin []> (<type 'exceptions.TypeError'>, TypeError("object of type 'NoneType' has no len()",), <traceback object at 0x7fb54672f3f8>) [('/home/rufwebot/pynik/ircbot.py', 64, 'execute_plugins', 'plugin.__class__.__dict__[trigger](plugin, self, *arguments)'), ('/home/rufwebot/pynik/plugins/title_reader.py', 89, 'on_privmsg', 'bot.tell(target, self.clean(url, title))'), ('/home/rufwebot/pynik/ircbot.py', 112, 'tell', 'return self.client.tell(target, message)'), ('/home/rufwebot/pynik/ircclient/ircclient.py', 91, 'tell', 'if len(string) >= 399:')]

@dentarg dentarg added the bug label Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant