Brosteins

Developers, Technology Evangelists, Bros.

NativeScript Tweet Bot

I’ve spent the last month building workshop and presentation content for Music City Code, held in Nashville, TN. I spoke about NativeScript throughout the conference, met a ton of new friends, and had fun building apps, and automated products. One of the products of my preparations is a cool side project I call the NativeScript tweet bot.

6 Minute Mobile Apps with NativeScript: A Race Against Time

One of my sessions, 6 Minute Mobile App with NativeScript: A Race Against Time, required me to write 10 mobile apps with NativeScript in 60 minutes. I got pretty close: I made it to 5. 5 is a lot, but not what I promised, which was 10.

I suspected I wouldn’t be able to make it to 10 apps, so what I created a NativeScript tweet bot. It’s job is to automatically create NativeScript apps for me. Here’s how it works.

NativeScript Tweet Bot

Tweet me @MikeBranstein and include the hashtag #MakeMeAnApp. In a few minutes, you’ll get back a screenshot of your very own, customized NativeScript app. It take a little bit of time (2-3 minutes), but there’s a lot going on behind the scenes.

tweet-bot

  1. When you tweet @MikeBranstein with #MakeMeAnApp, it is detected by a listening Azure Logic App.
  2. The logic app does one thing: if a tweet it detected, it queues a Visual Studio Team Services (VSTS) build.
  3. My Mac build server (running a VSTS build agent) listens to the queue and picks up the build request
  4. A Github repository is downloaded, containing a NativeScript app template
  5. The original tweeter’s user name is injected into the app
  6. The NativeScript app is built and run, using the NativeScript CLI
  7. The iOS simulator starts and loads the app
  8. A screenshot of the running app is taken
  9. The screenshot is submitted to an Azure Web App running a Web API service
  10. The service negotiates with Twitter and send the image as a reply tweet

Successful Talk

Even though I didn’t personally make 10 NativeScript apps in 60 minutes, with the help of the audience, I was able to make a total of 15 apps. Thanks every one!

Unfortunately, I can’t leave the tweet bot running forever, so I’ll leave it up for a few more weeks. Hope you can try it before then!

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.