Hardware, Software, Firmware, and Everything

Category: PHP Programming

Using Tropo SMS gateway with BusTracker

SMS Bustracker works with “Obama Phone”


A pinch of Tropo, a dash of Bustracker, fold in a pound of jata with PHP, bake for an hour and you have jata-sms.

My Android smartphone suffered a breakdown last week.    New parts should arrive soon.  But in the meantime, I was at a loss without my favorite Android app jata.  I use it to get bus arrival times with the local WRTA Bustracker.  Bustracker has a text message interface, and I thought I would try that with the backup TracFone (Safelink Obamaphone[1]).  That didn’t work.  The TracFone Terms and Conditions states that “TracFone does not generally participate in Premium SMS services or campaigns.”  The Bustracker SMS number is 41411, a shortcode for Textmarks, and I guess Textmarks is a premium service.  Then, I remembered Tropo, a gateway for voice and SMS.  It offers a free developer account and phone number, and now I had a motivation to work with it.

  1. [1]There could be a whole other discussion about giving away the razors (phones) to sell the blades (20 ¢ / min airtime), but I’ll leave that for another day.

Optimizing MySQL tables “on the fly” for gtfs data

I’ve been importing gtfs files into MySQL tables. There is a wide variation between data types for different agencies, as there is no standard for data types. For instance, GTFS trips.txt has a trip_id column, where a typical value is  “94108050”, but PSTA has “973379-JUN13-HQ-Weekday-02-0000100”!

Whitespace in PHP files

PHP, JavaScript,  and HTML each have their own idiosyncrasies, but they all lack what I would consider useful features of a more strictly typed language like C or C++.   After years of using C and C++ for micro-controllers and applications, I don’t recall problems with whitespace.  Recently, I’ve been working on the client side of an application for Android phones.

Use wget to debug remote XML feeds using XmlPullParser

I was working on an Android app, jata which depends on getting data from a web based server which uses XML  I tried using an Android Document object  org.w3c.dom.Document and it worked well, but I switched to using an XmlPullParserfor performance reasons

Recursively Clear Directory with PHP

I was working on a PHP program that reads  zipped files, extracts wanted files, stores the contents in a MySql database, and finally cleans up the contents of a local tmp directory.  I develop and debug the program on a local LAMP server, then upload and test it on a public web server.  I thought it was all finished, when I noticed that the public server printed out some PHP warnings that it was trying to unlink a directory, rather than a file.

Powered by WordPress & Theme by Anders Norén