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/

TutsPlus.com:
Building Your Startup: Delivering Notifications
Nov 04, 2016 @ 15:54:14

TutsPlus.com has posted the latest part in their "Building Your Startup with PHP" series today with a focus on delivering notifications to your users when meeting information is updated.

This tutorial is part of the Building Your Startup With PHP series on Envato Tuts+. In this series, I'm guiding you through launching a startup from concept to reality using my Meeting Planner app as a real-life example. Every step along the way, I'll release the Meeting Planner code as open-source examples you can learn from. I'll also address startup-related business issues as they arise.

In the prior episode, I described building the infrastructure for tracking changes to meetings so we would know how to share updates with participants. In this episode, I'll cover monitoring the log and delivering email notifications of changes.

They start with a look at monitoring for updates to current meetings via a "actionFrequent" method and the code required to locate and notify the correct people of the updates. Next up is the logging of these changes to the audit log and pulling a history of the meeting to show what actually changed. Finally there's code to deliver the actual update email.

tagged: build startup series meetingplanner deliver notifications change meeting tutorial

Link: https://code.tutsplus.com/tutorials/building-your-startup-delivering-notifications--cms-26595

SitePoint PHP Blog:
Push Notifications with Prowl
Aug 22, 2013 @ 14:04:34

On the SitePoint PHP blog there's a new tutorial posted (by Lukas White) about connecting PHP with Growl notifications using the Prowl iOS-based tool.

Suppose, however, you want a quick and easy way to send messages to yourself or a select group of people without having to register an application with Apple and play around with various certificates and processes. You might be interested in learning about Prowl. [...] You can purchase a copy for your phone and “hook it up” to all sorts of services and applications – and perhaps most intriguingly, use its API to send messages from your own applications. That’s what we’ll look at in this article.

He helps you get all the pieces you'll need to get the example working - signing up for Prowl, downloading the iOS application and grabbing the API library from Github. He includes example code to set the provider key, create a filter for sending the message and pushing the request out to the API. He also includes an interesting example of a logging integration with Prowl and a ZendLog. He creates a custom log writer you can drop into your code.

tagged: push notifications prowl growl tutorial api

Link: http://www.sitepoint.com/push-notifications-with-prowl

PHPMaster.com:
Using Facebook’s Realtime Updates and Subscription API
Aug 19, 2013 @ 16:35:47

On PHPMaster.com there's a new tutorial showing you how to use the Facebook API and get real time subscription information and updates using this code as a base.

Facebook’s real-time updates allow us to declare our interest in certain information about our users and have Facebook notify us when it changes instead of us continually querying the API. [...] There are of course other uses for real-time updates – and indeed we’ll take a look at one in this article: an example application which emails people when others “unfriend” them. (Actually that’s not strictly true – it tells you when someone is no longer your “friend” regardless of who did the unfriending.)

He helps you get everything you'll need installed (via Composer) including the Facebook SDK, PHPMailer for emails and Underscore for output handling. The sample interface uses a Slim-based structure (a PHP microframework) to make a callback URL that the Facebook application uses for it's real-time notifications. There's also an endpoint that's called when people allow the application access to their accounts, complete with the redirect URL. They show you how to handle the incoming JSON message from Facebook and how to create the email contents and send it out.

tagged: realtime subscription api notifications tutorial facebook slim

Link: http://phpmaster.com/using-facebooks-realtime-updates-and-subscription-api

Justin Carmony's Blog:
SMS Nagios Notifications with PHP & Twilio
Jan 31, 2012 @ 18:40:46

In this latest post to his blog Justin Carmony looks at a system he created to hook his Nagios notifications into the Twilio web service and have it notify him via SMS with something was wrong.

In the past I would just use my iPhone's email-to-txt email address. However, when I received the txt message, it wasn't formated very pretty, and it would have a different "From Number." So if we had a crazy day, I would have 20-30 message threads in my iPhone all about Nagios. [...] What I like out this setup is with Twilio, I can buy a phone number for $1 a month. So all my notifications come through the same number.

He's included the PHP code he uses to send the notifications (using the Twillo library) and the Nagios commands he configured to send the notifications to that script via the command line.

tagged: sms nagios tutorial twilio notifications commandline

Link:

IBM developerWorks:
Build a web-based notification tool with XMPP
Jul 28, 2010 @ 15:57:50

On the IBM developerWorks site there's a recent tutorial about using PHP and Javascript with the XMPP to create a small web-based notification tool (called Pingstream).

Real-time web applications are networked applications, with web-based user interfaces, that display Internet information as soon as it's published. Examples include social news aggregators and monitoring tools that continually update themselves with data from an external source. In this tutorial, you will create Pingstream, a small notification tool that uses PHP and JavaScript to communicate over the Extensible Messaging and Presence Protocol (XMPP), a set of XML technologies designed to support presence and real-time-communications functionality.

You'll need to already have the usual software installed - PHP, Apache and MySQL - as well as a few others: Openfire, jQuery, Strophe, XMPPHP and LastRSS. They introduce some of the concepts behind real-time messaging, the XAMPP protocol and, of course the code to show how to create their service.

tagged: xmpp tutorial web notifications pingstream

Link:


Trending Topics: