Category Archives: PHP

CodeIgniter, FuelPHP, and Sparks Oh My!

The Atlanta PHP meetup in February was a good one. Nic Rosental gave an entertaining and informative talk on the ecosystem surrounding the CodeIgniter PHP framework. Nic gave a brief overview of each of these platforms:

  • CodeIgniter
  • Sparks (package manager)
  • Bonfire (framework bootstrap)
  • FuelPHP (yet another framework)
  • PyroCMS (free/commercial CMS)
  • ExpressionEngine (commercial CMS)

Before the main presentation Logan Gray gave a quick demo of CodeIgniter.

My impression of CodeIgniter is a lightweight and easy to use framework for PHP which I plan on getting into during 2012. I learned about FuelPHP for the first time at the meetup and and will definitely take an exploratory dive into this promising framework sometime soon.

The sponsor for the meetup, Thompson Technologies, provided catering from Willy’s Mexicana Grill and a Kindle Fire for the end of meeting raffle…nice!

First PHP Meetup of 2012 was a good one!

Strongbox West PHP User Group Meetup

Really enjoyed the January 2012 meetup of the Atlanta PHP User Group…held on January 19th at Strongbox West. This was a joint meeting with the Atlanta MongoDB user group and the presenter was Richard Kreuter who gave an entertaining and informative talk on the fundamentals of MongoDB. Interesting to learn that MongoDB is the database used by both Craigslist and Foursquare…who knew? The sponsor for this meetup, 10Gen.com, provided much appreciated pizza and chicken strips as well as MongoDB coffee cup swag for all attendees. Before the meeting I hung out as usual at MidCity Cafe on West Peachtree where the feature is 1/2 price pints from 4 to 7pm was in effect! Looking forward to February’s meetup!

 

API Fun with Quickbase and Mailchimp

Things have certainly changed in the past 2-3 years as business process automation technologies have evolved from primarily being on premise technology stacks by companies like IBM, Microsoft, and Oracle requiring on site system administrators to keep them running…to a new public cloud technology model from companies like Salesforce, Intuit, Google, and Amazon. These new public clouds are focused more on providing solutions rather than infrastructure. More and more often nowadays the job of creating business process automation solutions entails piecing together a smorgasbord of technologies from a variety of vendors most of whom are in the cloud.  Whereas in the past developing these solutions required developers to know a great deal about the underlying operating systems…today the process is more about creating solutions without having to know anything about the underlying platform running the solution. Automating systems is now often more about writing small amounts of code to connect different cloud platforms thus creating unique and innovative solutions to business problems.

In this vein I recently had the opportunity to develop an interface between Quickbase and Mailchimp. Quickbase is a cloud platform from Intuit for building custom database applications and Mailchimp is a cloud based email marketing service.

In this business scenario Quickbase is a customer relationship management (CRM) system where new leads are collected into a Leads table via direct input, mass import, and web forms from company websites. Mailchimp is used for email marketing campaigns and periodic newsletters.

The problem was to create an interface between Quickbase and Mailchimp so new leads collected in Quickbase could be automatically synced with mailing lists in Mailchimp.

I chose to create a PHP script with the Quickbase API to query a Leads table in Quickbase and sync the result set with a  subscription list in Mailchimp. On the Quickbase side I took advantage of a PHP wrapper developed by Joshua McGinnis, a Software Engineer  at Intuit, Inc.  based out of  Waltham, Massachusetts. On the Mailchimp side I was able to take advantage of  the Galahad MailChimp Synchronizer, a PHP wrapper provided by Chris Morrell.

My PHP script simply had to read the result query array from Quickbase and write the data elements into a new array in the format required by the Galahad Synchronizer.

Once completed I ftp’ed the script onto a LAMP hosting account, setup a Cron job to execute it hourly, and tested by adding new Lead records into the Quickbase table.  Then an hour later confirming the new Leads are added to the Mailchimp list as expected.

This system assumes the list in Quickbase is the master so once a lead is removed from Quickbase it is also removed from Mailchimp.

Here’s the code if you are interested:

<?php
require_once 'Galahad/MailChimp/Synchronizer/Array.php';
require_once 'MailChimp/MCAPI.class.php';
require_once 'quickbase/quickbase.php';
// =============================================================================
//  SET THESE
// =============================================================================
$apiKey = '9072e9b2028444af-us1'; // mailchimp api key
$list = 'c150f6eba1'; // mailchimp list ID
$quickbase = new QuickBase('userid', 'password',true, 'bgmk5dsfc');
$res=array();
// setup the query to quickbase > field id 112 equals yes
$queries = array(
array(
'fid' => '112',
'ev' => 'ex',
'cri' =>'yes')
);
// quickbase api query with field id list
$res = $quickbase->do_query($queries,'','','10.6.7.3.110.111.24.23','');
$email_results=array();
// write array elements from $res into a new array $users in the format required  by Galad Synchronizer
 $j=0;
 foreach($res->table->records->record as $record)
        {
            $i=0;
            foreach($record->f as $value)
            {
                $field_name[$i]=$value;
                $i=$i+1;
            }
$users[$j] =
array('EMAIL' => strval($field_name[0]), 'FNAME' => strval($field_name[1]), 'LNAME' =>
strval($field_name[2]), 'MERGE3' => strval($field_name[3]),
'MERGE4' =>  'bgmk5dsfc', 'MERGE5' => strval($field_name[4]), 'MERGE6' => strval($field_name[5]),
'MERGE7' => strval($field_name[6]),
'MERGE9' => strval($field_name[7]),
);
$j=$j+1;
         }
// =============================================================================
//  THAT'S EVERYTHING
// =============================================================================
// call the synchronizer
$Synchronizer = new Galahad_MailChimp_Synchronizer_Array($apiKey, $users);
$Synchronizer->sync($list);

Building Facebook Apps at the Atlanta PHP User Group July Meetup

Jason Bouffard, Lead Facebook and PHP developer at Definition6, was the presenter at July’s PHP User Group meetup held at Strongbox West.  This meetup was completely full with over 50 php developers. Free pizza and soft drinks were provided by event sponsor Definition6. Jason’s talk covered his experience developing and launching a Facebook app, True Blood Immortalize. His very creative presentation is located online here.

 

July PHP Meetup at Strongbox West
Jason Bouffard, Lead Facebook and PHP developer at Definition6, presenting at July PHP meetup

Web Services Magic at the November PHP Users Group Meetup

The November 2010 Atlanta PHP Users Group Meetup held on November 3rd covered web service APIs for Twitter, Facebook, and Amazon.

Moses Ngone gave the fist presentation, an introduction to web services. Moses did a good job explaining the main components  of web services…access, request, and handle response. He then drilled down into more detail on  each component. First on access methods…none required, basic authentication, and OAUTH which is quickly becoming the standard. PHP requests consisting of curl or file_get_contents. And finally response takes the form of  xml, json(p), or serialized.

Next up Joey Rivera presented on the specifics on using web services of Twitter, Facebook, and Amazon. Joey’s presentation included lots of good code examples and useful tips like using the ZEND framework to handle all of the oauth magic for you. All of Joey’s code examples and presentation can be found here on his website.

The meetup was packed with only a handful of empty seats. I counted 32 attendees.

I always enjoy these technology meetups and seeing first hand the enthusiasm and passion of Atlanta’s technology community.

Funny thing after the meeting (which was held in room 577 at Colony Square) I stepped onto the Arts station Marta platform and to my surprise there stood my next door neighbors waiting for the same train. For anyone not living in Atlanta…this is a once in a lifetime coincidence I can assure you. So I even got a welcome ride home from the Marta station…a nice ending to a nice evening.