Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Home-Made Twitter and Gmail Notifications with PHP and Arduino
Jan 16, 2017 @ 16:48:54

On the SitePoint PHP blog Christopher Pitt is back with another tutorial showing you yet another "odd" use of PHP. In this latest post he shows you how to integrate PHP and an Arduino to relay Twitter and Gmail notifications.

I am a little obsessed with Twitter. It’s how I communicate with most of the developers I’m not fortunate to live in the same city as. I’m a little less obsessed with IoT projects, but then it’s harder to find the time to work on them than it is to check Twitter.

Unless I can do both at the same time.

Ever since the IoT week, I’ve been meaning to work on a project that will let me know when someone wants to speak to me. Something that looks cool, and is at the same time non-invasive. This is what I’ve come up with...

He connects the Arduino with a RBG LED and a a proximity sensor to a PHP script that will change the LED color based on the notification type. The sensor would allow some "hand waving" to dismiss the notification as "read". He then starts in on the hardware side of things including some illustrations of the Arduino board and how things connect. With that simple setup in place he moves over to the software side, creating a Notifier service interface and using the "endroid/twitter" package to connect over to Twitter. He then walks through the creation of the Gmail and Twitter applications, grabbing the related OAuth credentials and dropping them into the script's configuration file. He builds out notifier classes for each service and hooks it into the Arduino with the Firmata and Carica libraries. Finally he hooks it all together with a bit of SPLQueue functionality to loop and listen for new alerts to relay to the Ardunio.

tagged: arduino twitter gmail notifications tutorial proximity sensor led

Link: https://www.sitepoint.com/home-made-twitter-and-gmail-notifications-with-php-and-arduino/

Christopher Jones' Blog:
Location Awareness With Oracle Spatial in PHP
Mar 27, 2008 @ 12:50:11

Christopher Jones has posted a script to his blog today giving an example of how you can use the Spatial functionality of Oracle in a PHP application:

Oracle Spatial is a powerful library for adding location awareness to applications. This script uses the core subset of Spatial, called Oracle Locator, which is included in all Oracle Database editions.

His example connects to the database resource and makes a few example SQL queries: one that uses the sod_nn() function built in to the Spatial package to grab the store locations close to the customers, another that finds the latitude and longitude for a customer's information and a method for querying an object collection of locations in a given area.

tagged: oracle database spatial locator example latitude longitude proximity

Link:


Trending Topics: