Tweeting With Scanalyzer

This demo shows how Scanalyzer can be used to send data to a Twitter feed or email address automatically.  This could be done to keep a record of assets locations, make a wish list, or send a notification when work is being done on an asset.  Again, we've done some of the legwork for you and created this simple example.



QUICK CONFIGURATION CODE



PRIVACY

This Code
INSTANTLY

Sends
BARCODE

To
TWITTER
(@YOUSCANITWEET)

Twitter Demo

Before you scan this Quick Configuration Code to get started, please note the accompanying privacy advisory. 

Once you've scanned the configuration code, scan another barcode.

Now, visit this Twitter page to see your tweet appear in your feed:


You should also see a notification on your device that shows the data you sent.

Instructions that walk you through how to set this up follow.  Enjoy!

Tweeting with Scanalyzer Tutorial



  • Note that in order to facilitate scanning to Twitter, we found a service, in our case TwitterMail.com that can perform this task.  Reserve a TwitterMail before reading on or you won't have much success.

  • We used a Google Site for our example, so that's where we made the script...
function doGet(e)
{  
  
  //Initialize the app...
  var app = UiApp.createApplication()
                 .setStyleAttribute("backgroundColor","#33CCFF");
  var vPanel = app.createVerticalPanel()
                  .setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER)
                  .setWidth("100%");
    
  //Create a welcome message and data labels 
  var welcomeLabel = app.createLabel("You just Tweeted: ")
                        .setStyleAttribute("fontSize","36px")
                        .setStyleAttribute("color","white")
                        .setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER)
                        .setWidth("100%");
  var dataLabel =    app.createLabel(e.parameter.data)
                        .setStyleAttribute("fontSize","48px")
                        .setStyleAttribute("color","white")
                        .setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER)
                        .setWidth("100%");
  var thankyouLabel = app.createLabel("Thanks for Tweeting!")
                        .setStyleAttribute("fontSize","36px")
                        .setStyleAttribute("color","white")
                        .setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER)
                        .setWidth("100%");
  
  MailApp.sendEmail("thekeyyouweregiven@twittermail.com", "New Tweet", " - "+e.parameter.data+" was just scanned using @Scanalyzer.  #iphone");
  
  //Create a grid for better formatting...
  var mygrid = app.createGrid(6,1)
  mygrid.setWidget(1,0,welcomeLabel)
        .setWidget(3,0,dataLabel)
        .setWidget(5,0,thankyouLabel);
  
  //Add the vPanel to the App
  app.add(vPanel.add(mygrid));
  
  return app;  

  • Substitute your TwitterMail email address in place of ours, or use a different email address if you simply want to send a message or an alert each time you scan.

  • On the Share menu, Publish the Script as a Service and grab the URL for use in your configuration code.

  • You'll need to add &data= to the end of the URL, and then tack on the Scanalyzer tags of your choosing.  Note: We're using %09 for the tab character.
  • Configure Scanalyzer Pro with your automation string.  You can cut and paste ours if you want to test it out:
https://sites.google.com/a/macros/mcdanielar.com/exec?service=AKfycby55bck06e2Va6VAnxvsWaF4EUId3NV0enlBBlZVg&data=<barcode>