Saturday, March 2, 2013

PHP work and APIs

I've been learning PHP for a while. I think I have a long way to go but I have completed a few projects in PHP and have a fair amount more that I'm working on. My most recent portfolio website is written in PHP. It queries a MySQL database for the contents of a page and then it dynamically builds the page. That includes dynamically building the navigation links on the said, breadcrumbs and so on. The PDFs that I host also are shown on their own generated page. It's really neat.

Something else I've been working on recently is a utility for the local Amateur Radio club I belong to. It's a membership roster that can be managed online. Each member is stored in a database and I will have a page to edit details and another page to add a new member. I haven't completed the edit page just yet. It loads the member's details and even generates a form with the correct input elements for the data type. Checkbox for bool, textbox for varchar, date (HTML5) for date. The date picker in HTML5 is really neat. I have it show the ID field but greyed out because that is not user generated. I'll have to add some sort of authentication to this before I turn it loose. I also want to add some tracking for who the officers are, and maybe even some tracking of who is in what committee because they do those too. Another thing that I will add is the ability to download a PDF copy from the roster page and also to send out some sort of version to the email list, like what normally happens. It'd be great if I could integrate this into Drupal, at least for authentication, but I don't know that is going to happen. I did write a PHP script that can be used to look up someone's information by their callsign. Originally this information came from the FCC but I am using the API and querying their database for it.

Something else club related that I would love to write is a callsign logging program for the club to use on field day. Especially if I can put it on a Raspberry Pi with a WiFi router in a box, then each station could have a laptop connected over wifi that would show the page and let each individual station make entries. Field day also is a competition so you get points for so many contacts in various situations. That could be handled by the computer and it could give real-time results. Maybe with a 1200-baud packet radio link those results could be sent somewhere with an Internet connection and shown live on the club's website, or posted to Facebook.

For work I wrote a PHP script to be run at the command line in Windows and using TCPDF it would scan through a list of patients in the EMR software we support and print out 1 PDF per patient with all of the internal emails related to that patient. It looked really nice. I'm excited for the customer to see the result because I think they are going to be pleased.

I have a few more personal projects that I'd like to work on. One is a tracking program someone can use to keep track of their headaches and maybe more usefully.. taking medications. I'm 10% done with that. Another one is a gas log for my car and my wife's car. Yet another one is for groceries. All of these I'm working on something that shows up fine on a cellphone browser. My wife could be at the store and looking at the list on her phone. There are utilities that should integrate letting me do barcode scanning with the camera. Eventually, a couple years down the road probably, I will have something that can suggest sales and help us save money by buying at certain times.

Another idea I had the other day is I would like to write a PHP class that can take a string input consisting of the contents of a Tiddlywiki file. Then using the class methods I can easily extract information from the Tiddlywiki. Once that is done, I may inject that information into a MySQL database. I just have to figure out how to use the DOM methods in PHP to look for the div containers that Tiddlywiki uses and then pull various information from it including the contents.

There are a couple of APIs I need to learn for work:
Google Analytics
I'll be using these to build a nice application for someone with a lot of reporting and control.
I hope what I learn can be applied to other places. I'd love to write something that uses the API to help me keep track of wish-lists and maybe even make purchases. (Maybe not, if I have something stuck in a loop that orders 1000 copies of a CD I want, that wouldn't work out well for me)
I'd also like to connect to Facebook and Twitter over their APIs.

No comments:

Post a Comment