Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

fat ninja avatar image
fat ninja asked

Alexa Skill for reading most recent twitter feed?

Does anyone know or have a working example of what the lambda function would look like to grab onto a twitter feed and read back the most recent tweet? I got my garage door responding to Alexa but would like to be able to ask what the status of the door is. I am thinking I could have my Arduino post to twitter what the status of the door is, and then set up a skill so alexa could pull the most recent twitter post stating the status of the door. This would be a very minimal skill but I am looking for some degree of notification/status from the Echo. If anyone is interested, I can do a you tube video of what I have going so far.
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fat ninja avatar image
fat ninja answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
That seems a rather convoluted approach. But twitter's API is documented here: https://dev.twitter.com/rest/public I didn't use this for Tweet Poll. I used IBM's Insights for Twitter. But was interested in tweets in the aggregate, not individually. If I were you, I would rethink your approach. Unless you are just doing this for self amusement as a hobbyist, this won't scale.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fat ninja avatar image
fat ninja answered
Thanks, I agree that the twitter feed probably wont do what I was hoping for. I am looking for a way to add a status update so that if the echo is asked it will respond with the state of the door. Currently I don't have that. I can make the garage go up and down, but the echo has no idea what the current state of the door is. The twitter idea was mostly cause I have seen examples of the arduino yun posting to twitter. I have seen some videos on SONOS where a the echo reads the metadata of a sudo file, while a Rest url is sent to the Sonos to play the song. Maybe something like that could be done. Edit the metadata of a file to reflect the status of the door. Or maybe there is an easier solution out there? This is all just a hobby approach with me :) I appreciate your input. thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Galactoise avatar image
Galactoise answered
Your problem is an interesting one - you essentially have something that is entirely stateless, except you need to store exactly 1 bit of data (a boolean representing open or closed). With that use case, spinning up a data store of any kind is going to be massive overkill. Using Twitter as a boolean datastore is kind of crazy, but admittedly it probably meets your use case pretty well. I'm sort of curious, though - your lambda is calling out to the arduino controlling your garage door, right? Is there not a way for you to query the arduino for the door's state?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fat ninja avatar image
fat ninja answered
Hello Galactoise! There are ways to query the door's state, but none that I have found so that Alexa can query it. If the amazon echo adds the ability to review previous events on a google calendar I think I might be able to get this hammered out pretty easy. Maybe I could log the status to dynamodb and have a lambda function that would parse the most recent entry, but I am not sure how that would look or if dynamodb is even something the alexa skills can use. Be one good example if they did. take care!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fat ninja avatar image
fat ninja answered
Looks like I may have just found a dynamodb solution. https://github.com/amzn/alexa-skills-kit-js/blob/master/scoreKeeper/README.md
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-3a8bdf82-c941-457d-8923-0ff1c1a67527 avatar image
newuser-3a8bdf82-c941-457d-8923-0ff1c1a67527 answered

There is a skill called Tweets Feed, is that what you want?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.