Tropo and the Holidays

My son has gotten to the age where he doesn’t know that he wants for Christmas and is resorting to just asking for money (he’s saving up for a new computer).  I’ve never really liked just giving money to the kids, but I wanted to give some money to go towards that new computer, so instead of just giving it to him I created a scavenger hunt.  And because we are both nerds, I had to integrate some technology into the scavenger hunt, so for two of the legs of the hunt I wrote a couple of simple Tropo scripts that both he and his brother could interact with through SMS and voice calling.  I thought I would do a simple write-up just to kind of show you what you could do with a very short development time to write an application that could be more business relevant than your kids’ scavenger hunt.

What the Script Does

As I said before, I wanted to integrate this into two points of the hunt.  The first clue that they found related to Tropo just had a phone number on it.  My guess was that, despite being in the text messaging generation, they would probably call the number first (I was right).  When they call the number the script should play a message like “Who calls people anymore, maybe text me hello instead?”

When they text hello to the number, it will respond with a riddle.  If they answer the riddle correctly it will send a text with the next clue (someplace in the house that the next clue is found).

Lastly, for the final clue, they will be told to call into the number and listen to the messaging about people not calling anymore and they will then need to say a phrase.  After saying the correct phrase, the script will send them a text message that has the final instructions (for my purposes, I wanted them to say some embarrassing phrase to a room full of their relatives).

That’s it!  For the explanation of how it worked, I will break out the scripts into voice (where the interaction is started by placing a voice call) and SMS (where the interaction is started by sending an SMS)

Keep in mind, that in order to do this, you will need to create a free account on tropo.com and then you will need to create a new application and assign a number to it.  (You will also need to request SMS access if you don’t have it already).

Voice

For this portion of the script we need to start with prompting the caller and give them a clue to send in a text message.  As you can see below, telling Tropo to play that message is as simple as putting in a single command:

result = ask("Who calls phone numbers anymore?  Maybe
text me hello instead?", { "choices":"I fart rainbows,
I love to dab"})

If we didn’t need to wait for input in the second part of the hunt, we could change “ask” to “say” and remove the choices section.  For the first portion of the hunt, that’s all that is needed.  From here they would send a text in and it would be taken from there.  The rest of the script is for the final part of the hunt.

Next, we check if they said one of the choices with a simple if statement:

if result.value == "I fart rainbows":

If they say that, the system will say (say command) a response message to them over the phone and send them a text message (message command) with the final instructions (phone number changed to protect the innocent):

 say("I know you fart rainbows, but it doesn't help 
  with the smell")
 message("Go into the room where dad is and say: 
  Attention please! Attention please! I fart 
  rainbows!", {
 "to":"+15125550000",
 "network":"SMS"})

And finally, if the appropriate phrase is not mentioned, just hang up:

 else:
 hangup()

And generally speaking, that gets the voice piece working.

SMS

The SMS logic is pretty straightforward and is just a series of if statements that look for certain text in the message.  If it doesn’t see anything that it is looking for then there is no response.  Both of my kids’ stuff is in there, but all of the appropriate information is gathered under “Joe” and “Sammy”.

if currentCall.initialText == "Hello" :
    say("Oh hello, is this Joe or Sammy?")
if currentCall.initialText == "Sammy" :
    say("What can you hold in your left hand that 
    you can't hold in your right hand?")
if currentCall.initialText == "Right hand" or 
currentCall.initialText == "Your right hand" :
    say("Good job, your next clue is: I need you 
    to scan something for me")
if currentCall.initialText == "Joe" :
    say("A boat has a ladder with six rungs, each 
    one foot apart. The bottom rung is one foot 
    from the water. The tide rises at 12 inches 
    every 15 minutes. High tide peaks in one hour. 
    When the tide is at it's highest how many rungs 
    are in the water?")
if currentCall.initialText == "0" or 
currentCall.initialText == "None" :
    say("Thats right. Your next clue is: Jupiter's 
    most wide")

Each if currentCall.initialText just compares what was sent in the initial text to a string.  If it matches, then it replies (still via SMS) to the person with the response that is right under the if statement.

That’s my simple script.  It was done in 30 minutes or less.  Had I more time, I would have done some identity checking via their cell number.  But just for two people to use in a simple fashion this did the trick.

Posted in Code

Send Your RSS Feeds to Twitter

rss2twitterWhen I first started out messing around with Engineering Deathmatch, I had two primary goals.  First, to help keep my skills sharp and expose me to new areas of technology.  Second, was to promote the engineers that were contestants on the show. As part of that second goal, I’ve wanted to promote the EDM contestant’s blog posts through the Engineering Deathmatch Twitter feed.  This is one of those tasks that I needed to automate because as more engineers get added to the EDM family I just won’t be able to keep up with all of the blogs and promote them in a reasonable amount of time.

To that end I had been using Twibble (twibble.io) and it had been working well, but I always knew that there would be a time that I would need to build my own environment like Twibble.  Partially because I didn’t want to worry about the upper limits of blogs that could be tracked and second because if I could build it myself and host it myself I wasn’t sure if their subscription fees were really worth it in the long run.  This past weekend I finally decided to give it a go and write my own little application to give me a good portion of what Twibble does.  With this post, I’ll walk you through the process that I used to make this work.  Here we go.

Functionality

There were some things that Twibble did that I really wanted to make sure that my new app did. These were the requirements that I originally defined that actually made me choose Twibble in the first place:

  1. Ability to monitor multiple RSS feeds.  Since for every episode that gets created there is the potential for two more feeds to be added to the blog I needed to be able to scale this solution to handle many blogs.  Initially the Twibble service had a top limit, even at their premium pricing tier, to the number of blogs that they would service.  They recently changed their pricing and I think that upper limit went up, but if I run my own, then I can duplicate it, throw more resources at it, whatever to make my upper limit whatever I wanted it to be.
  2. Tweeting pictures from the blog post.  Everyone knows that a tweet is more eye catching if there’s a picture to go with it, so I wanted to make sure whatever solution I developed had the ability to grab a picture from the post, if one existed, and include it with the Tweet when it posted to Twitter.  I looked through github and while there were several options for propagating RSS feeds to Twitter, I didn’t quite find one that had this functionality.

Environment

Because I had some knowledge of Python and I wanted to learn more about it (see, hitting on that first goal of Engineering Deathmatch) I decided to use that to develop the application for this.  I decided, even further, on using Python 3 because Python 2’s end of support has been announced for 2020.  Yeah, it’s still a ways off, but may as well start coding with the newer stuff!

Additionally, the goal was that I was going to stick this on one of the many Raspberry Pi computers that I have hanging around the house and have it running on a scheduled job.  That way I can stuff it in a corner somewhere and have it be out of the way.

Configuration

The first thing that has to be done, well I guess it doesn’t have to be first, but it needs to be done some time at the beginning, so may as well make it first, is to create your application within Twitter so you can grab some keys!  To do that, do the following:

  1. Go to apps.twitter.com and log in with your Twitter credentials.  You will be presented with a screen to name your application.  Give it a name, description and a web site.  Web site is required because the assumption is that you will be using this to allow other people to use the app.  for our purposes, that doesn’t matter.
  2. Once you have submitted that form, you will be taken to a page with information about your app.  Scroll down to the section that talks about keys and click on “Manage keys and access tokens”
  3. Copy the consumer key and the consumer secret key and put them in a notepad, you will need them later.  Towards the bottom of this page you will have a button to generate access token and access token secret.  Click that and copy town the values for the two resulting keys.

These values are what will allow your application to communication with the Twitter API.  There is a lot of stuff you can do with this, but for this project we will just be sending Twitter status updates.  We will use this stuff later, but set it aside for now.

Next, let’s install some Python packages.  If you only have Python3 installed, the command should just be: pip install <package>, however if you are using a Raspberry Pi, it has both installed, so the command should be pip3 install <package>.  Make sure you know what you have installed because if you have both the system will still allow you to install with the first command, but it will just be installed for Python 2.  You will need to install the following packages for Python:

  • feedparser – this will read the RSS feeds for you
  • configparser – this will read in configuration files that we will develop for this
  • bs4 – this helps us to search for image strings in the RSS feed so that we can download that image to post with the tweet
  • twython – there are several packages that allow you to use Twitter with Python, this just happened to be the one that had the most understandable documentation to add media into tweets.

Screen Shot 2016-06-08 at 8.56.24 AMAlright, it’s time to code!  Open your favorite text editor, the one I used was Atom, but whatever you’re most comfortable with will probably work.  I’m not going to go through a lot of the nitty gritty details of how to write out the code for this project, because you can go and look at all of the code that I used up on github here: https://github.com/engdeathmatch/RssToTwitterPy3  I’ve tried to include decent instructions on the repository page and I also tried to be pretty judicious in documenting my code.  So go check that out and I think it will get you well on your way.  A couple of things that you need to be aware of:

  1. You need to make sure that you have the auth.cfg file and fill in the details of your Twitter app that you got in the first part of this.  Without this, your application won’t be able to talk to Twitter.
  2. You need to fill out the feeds.cfg file with the usernames and feeds that you want to follow.  I used the usernames because I wanted to attribute the engineer to the blog post that I was promoting (for instance, via @samplefive)

Once you have your code all created and on your Raspberry Pi and it works when you execute it (you can do this with: python3 <filename>Smilie: ;), then next thing that you will want to do is create a job to schedule it.  I spent a good deal of time on this because I couldn’t, for the life of me, figure out how to make a scheduled task from within Linux that would properly kick off my Python file.  What I ended up having to do was create a shell script that then called the Python file and schedule the shell script.  From the command line on your Raspberry pi, enter:

sudo nano runrss.sh

That will take you into an editor, this file is pretty simple.  Here’s an example of what mine looked like:

#!/bin/sh
python3 rsstotwitter.py

Hit Ctrl-X to exit and save the file and then you are ready to schedule your application to run regularly.  Type the following:

sudo crontab -e

This will take you to the scheduler file.  Go towards the bottom of the file and find an extra line and enter something like this:

*/20 9-20 * * * cd /home/pi/appfolder && ./runrss.sh

Make sure that you have a blank line underneath that commad.  So what does this do exactly?  The first portion */20 9-20 * * * tells cron that this job should run every 20 minutes between the hours of 9 AM and 8 PM on the server.  It then changes the directory to where the application is located so that any path statements in the Python script that are just in the same directory will be mapped correctly, and finally it runs the script.

Wrap-up

So far the application is working pretty well, and maybe you even stumbled across this post from a Tweet that came through it.  There are a couple of things that I will be looking to do in the long run including:

  • Configure the application so that it automatically takes older links out of the log, just so that tracking file doesn’t get unbearably large.
  • Build in some intelligence so that if the script encounters more than one post at a time to tweet out it can schedule them to be tweeted a little further apart from each other.

But as far as a replacement for the service that I used to be using, it has replaced the core functionality quite well!

Posted in Code

IT Will Steal Your Job (Title)

Lately I have been thinking about some of the interesting terminology that IT professionals have in their job titles.  I have been wondering if professionals in other non-IT career fields get pissed off at those of us in IT for stealing their job titles.  While I haven’t ever been confronted about this myself, about a year ago my brother-in-law was joking with me that he couldn’t compete in Engineering Deathmatch, despite being an engineer.

And that’s what really got me thinking about it.  According to the National Society of Professional Engineers there is a certification process that one must go through in order to call themselves an engineer that involves licensing boards, certifications tests and more.  By contrast, in my first “Systems Engineer” role, I had a degree…in marketing.  I have to imagine that there are some professional engineers (how I will distinguish non-IT engineers) out there that may get pissed off when they hear and IT person say that they too are an engineer.

I don’t want to just pick on the term engineer, IT has many instances of, let’s say, borrowing titles from other professions.  For instance: architects, developers, designers, Cisco even has an associate level certification, which I guess could pull from legal maybe?  I’m sure that I could go on if I thought harder and I encourage you to note any that I have missed in the comments.

Ok, so why the heck am I writing about this now if all my thought processes were kicked off over a year ago.  Some might just be content with the explanation that I’m slow, but honestly this hit home very recently.  As some of you may know, I am the creator and host of Engineering Deathmatch, an online web TV show that pits IT engineers and their configuration abilities against each other.  At the end of the year I filed for Engineering Deathmatch, LLC to be a real company.  A couple of weeks after finalizing the paperwork for the company, I received a package in the mail from the Texas Board of Professional Engineers.  Apparently there is a law in TX that was put on the books in 1937 that states that if you have Engineer or Engineering (regardless of the fact that it is followed by the word “Deathmatch” ) in the name of your company then you must have certified professional engineers on staff or performing the work that your company does.  As Engineering Deathmatch performs no structural, mechanical, electrical, or any other sort of non-IT engineering we don’t have anyone like that on staff.  As a result, I’m going to have to change the registered name of the company.  You will continue to see Engineering Deathmatch as our show name and domain name.

I guess that’s why I have never really received that much grief from professional engineers.  We can take their titles alls day long, but they are still the ones protected by nearly 100-year old laws.

Posted in Uncategorized

Unity Connection – Your Name’s Too Long!

Long-place-name

Long-place-name

File under things you shouldn’t see too often: A few weeks ago I was supporting Greg Casas, an engineer at our company that was working on upgrading a customer’s Cisco collaboration environment.  Everything was going well until he started upgrading Unity Connection. The upgrade of connection would get through the refresh upgrade portion, but would fail after it rebooted and started working on the rest of the upgrade.  After some wrestling and a TAC case we discovered that the issue had to do with the Unity Connection server FQDN being too long.  Just for example, let’s pretend that the fully qualified domain name for this system was unityconnection1.ilovesamplefives-voicemailsystem.samplefive.local, ok, yeah it’s a ridiculously long name, but we ran into a name about that long at the customer site.  With version 8 there was not an issue with the super long FQDN, however the upgrade to 10 failed as a result.  I’m not sure, but either the database structure changed with the upgrade or the field that the name was stored in went from just storing the name to the FQDN.  In either case, the limit for that field in version 10 is 63 characters.

Posted in Unity Connection

It’s Hip to Be Squared

squared-video

A few weeks ago at the Cisco Collaboration Summit Rowan Trollope made several announcements of new products coming out from Cisco in the realm of collaboration.  One of them was a we service called Project Squared.  Rowan’s description of the service went kind of like this (HIGHLY paraphrased):

Everything that you have typically had in an office or conference room in the past has been replicated in the digital world.  For instance, you used to have folders to store files in.  On your computer you have the same context.  You used to have a rollodex, now you have a contact list in Outlook or other contact management application.  The one thing that hasn’t been replicated for conference rooms is the room itself.  A place where you can keep all of the things that everyone needs to see.

Again, he was a lot more eloquent in describing this than I was, but that is the general gist of what was said.  But what does that really mean?  A virtual room?  I’ll have to admit when I first heard it I was a little skeptical, I had always thought of Webex as the meeting room, but maybe I was missing something.  I’ve been messing around with Project Squared for a few weeks now and using it for some business uses and I thought I would go through what my experience has been.

First Thing’s First

Before we get started, I should mention that Project Squared is still kind of a beta software that has been released to the wild, presumably in hopes that the user community will use it and make suggestions, bug reports and feature requests to Cisco in order to make the software better.  So you can sign up right now for yourself at http://www.projectsquared.com and sign up to see what all there is.

Being a beta product, it still shows a lot of promise. Many of the things appear to work as they should, but I have already made a few different suggestions on things to change.  When this was announced, Rowan Trollope mentioned that the development cycle to release new updates was going to be very short and to expect things to be implemented very quickly.  I haven’t necessarily seen any of my suggestions entered, but who knows where they were in the popularity stack.

So What’s It Do?

That’s the big question, right?  My initial thoughts when I logged into Squared were that it was a chat room.  Which it kind of is. When you log in, the first thing that you will want to do is create a room, you do that just by inviting people to a room by their e-mail address.  Nothing else is really required to get someone in here, just send an invite to their e-mail address and soon you will be chatting and sharing away.squared-video

In addition to that chatty stuff, you can upload and share files.  The files will be in a persistent list so that you can easily reach them even when the chat has pushed them way off the screen.  The interface has video built in as well, allowing you to do multi-party video calls without any video infrastructure in your environment.  Chat isn’t getting the point across that you need?  Just click the video icon and it will reach out to everyone in the room that you are in and attempt to get them to join your video call.

I will say that in thiphone-pse couple of video calls that I have done the quality was pretty darn good.  It’s about what you would expect out of a Webex video call, which makes sense since the back end of what is running all of this is the Webex cloud.

Speaking of the Webex cloud, one of the things mentioned a couple of times when this was announced was the level of encryption and security that is baked into this product.  While details weren’t specified, I’m sure that they are leveraging some of the security infrastructure that is already in the Webex and Webex Messaging products.

Currently there are applications to run on Android, iPhone/iPad as well as Mac.  There is also a fully featured web interface that looks and feels like the application interfaces.  The goal is to be able to use this service from wherever you are and I think they did a pretty solid job.  The apps work well and the web site is nice and responsive and works fine with the video calling without having to install anything else.  The not having to install anything was a huge thing in my book as far as user friendliness when using the web interface.  If my mind if you have to go install a variety of plugins then it is going to hamper user adoption, so bravo to Cisco for seeing this and making sure that plugins weren’t necessary.

So overall the user experience is pretty good, but since it is a beta application there were still some things that could use some improvement in my opinion.  And there are some things that may not be fixable.  Let’s get on to that.

So What’s Wrong With it?

As I have said before, this is a solid first attempt at an interface like this.  Everything works well and it has hooks so that you can use this with other applications, but there are a few things that if it were me I would change as soon as possible.

  1. The file browser for certain files does very well, but for others especially on the mobile side it leaves a little to be desired.  When one of my colleagues shared a word document, I tapped on it in my iPhone and it was just to small to read anything.  The native resizing gestures for iOS didn’t seem to do anything to help.  The best I could do to resolve this was to change my phone orientation to landscape so that it displayed a little bigger, but that’s kind of a poor resolution (pun intended).
  2. If you start a room with only one person it can only ever be a one person room.  I can understand that you may want to create rooms to ensure the privacy of what is said there, however I think there should be options to create a team room with only one other person to start.  That way if you are working on the project and the staff working on it is fluid you can add new people as needed even if it only started out as a two person room.
  3. My biggest issue, and the one that will be the toughest to tackle for Cisco is user adoption.  I think that a lot of people may see this as just another tool that they have to use that maybe they don’t see a value in.  A friend of mine and I both sent invites to teams at our respective employers and in both cases, though many were invited to a room only one showed up.  Now I realize that this was just a test room, but if it is difficult to get the engineering community that would recommend a tool like this to use it then it may be hard to get the regular user base to use it.  While I like using the tool and everything, sometimes it just feels like a solution without a problem.  Many of the things that it does can be accomplished with other applications, though not necessarily in the same place.  I’m just not sure what the adoption will be like when it’s one more tool that augments the tools that users already have.
  4. The last issue I see is really just one of perception.  While it’s definitely not the same product, when Project Squared was being announced I couldn’t help but think of Cisco Quad/Webex Social.  With those somehow attached together in my mind I can’t help but think about how unceremoniously those projects were cancelled and what would happen if the same thing were to happen here.  What is truly the anticipated life expectancy of this product?  In a recent discussion with Jonathan Rosenberg on Cisco Champions Radio Rosenberg stated that current measures for success are just whether or not people are using it, so for the near future at least that lifts a little bit of concern. We’ll just have to see how things evolve once features are added that will generate revenue for Cisco.

Let’s Stop Talking About Negatives

Ok, so those were the negative things that immediately jump out at me and really for a rev 1 product that list is actually pretty short.  As I said the interface is clean and intuitive and very responsive when you do things in it.  Honestly, why are you listening to me on this, the best way to tell if Squared is for you is to actually use it.  Get in there and get your hands dirty!  You should go over to projectsquared.com and give it a try.  Be there or be Squared! Yes, I went that far.

 

 

Posted in Uncategorized