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

SitePoint PHP Blog:
Hello, Laravel? Communicating with PHP through SMS!
Jun 27, 2017 @ 16:05:29

In a previous article the SitePoint PHP blog showed you how to use Laravel, the Twilio service and some helpful packages to create an application that allowed interaction via phone calls. In this new tutorial they continue the series and update the application to allow interaction via SMS messages.

In this article, we will modify our Laravel-powered phone-capable weather forecast app so that it is accessible via SMS (text message) in addition to the voice telephone system.

They just add on the functionality rather than creating a new application for the SMS side, adding new routes, controller methods and changing up the service layer a bit. It also includes the messaging that comes back from Twilio and how the response needs to be formatted. Finally, the article shows (with screenshots included) how to configure your Twilio application to allow messaging as well as phone calls. The post ends with screenshots of the application on a mobile device sending the requests for the weather information based on the zip code provided.

tagged: tutorial laravel twilio sms weather communication series part2

Link: https://www.sitepoint.com/hello-laravel-communicating-php-sms/

SitePoint PHP Blog:
Hello, Laravel? Communicating with PHP through Phone Calls!
Jun 20, 2017 @ 16:50:54

The SitePoint PHP blog has a new tutorial posted by author Christopher Thomas showing you how, with the help of Twilio, create a Laravel-based application that lets users communicate with it via phone calls.

Twilio is a SaaS application which enables developers to build telephone applications using web technologies. In this two-part series, we will leverage Twilio to build a weather forecast app that is accessed using the telephone system. The backend will be written with the Laravel framework (an exploratory video course is available for purchase here, or in the form of written tutorials here).

In this part, we will create a simple program that will allow a user to call a phone number that we buy from Twilio, enter a zipcode, and receive the current weather forecast.

You'll need to have a Laravel project already set up and a development environment to work in as well as Composer installed versions of Guzzle and the Twilio SDK. With that all set up, he dives right into the code, setting up routes and creating the "Weather" service class. This class is what's used to interact with the Twilio API and respond to user prompts with weather data from the weather.gov API. Next up is the controller that provides the endpoints for Twilio to hit and return the weather data back to their waiting connection. A bit of middleware is set up to sent the Twilio request signature each time and instructions are included on how to test the local system with the public Twilio API (using Ngrok).

tagged: laravel twilio phone call communication weather tutorial

Link: https://www.sitepoint.com/hello-laravel-communicating-php-phone-calls/

Laravel News:
Behind the app: Chrome Weather Extension
Sep 18, 2015 @ 17:38:18

The Laravel News site has a post talking about a Chrome extension to fetch the weather, created by Tim Leland, that's powered by a Laravel-based backend application.

Tim Leland has created a new Chrome Extension for getting not only the current weather, but today’s outlook, and a 5-day forecast. The extension automatically calculates your location and viewing the current temperature is as simple glancing at the menu bar. The temperature is always visible and when you click the button it loads the modal window as shown above. It’s simple and intuitive.

The Extension itself uses a Laravel backend and I wanted to find out more how it works.

The rest of the post shares the Q&A with Tim all about the extension. He answers questions about:

  • why he created the extension
  • how it works with the backend to pull the latest weather
  • where Laravel fits into the process

You can find the extension over in the Chrome store and get it installed.

tagged: laravel chrome extension weather interview background

Link: https://laravel-news.com/2015/09/behind-the-app-chrome-weather-extension/

PHPBuilder.com:
Incorporate Weather Data into Your PHP Web Apps
Sep 28, 2011 @ 18:44:29

On PHPBuilder.com today there's a new tutorial helping you integrate weather data into your site with the help of the Services_Weather PEAR package.

Regardless of whether you consider the weather to be an obsession or nuisance, there are plenty of opportunities to incorporate weather-related data into your Web application. The Services_Weather PEAR Package offers what is perhaps the easiest way to begin retrieving weather-related data.

Included in the post are the commands you'll need to get the package installed (via the PEAR installer) and sample code to set up the connection - in this case to Weather.com - to fetch the results for a search location. The "search" method will return the best guesses for your input and give you the unique code to use for fetching other values, like the current forecast.

tagged: weather data tutorial pear package servicesweather

Link:

Sudheer Satyanarayana's Blog:
A Bit Of XML, RSS And CURL In 7 Lines Of PHP And A Useful Program
Apr 02, 2010 @ 16:27:47

In a new blog post today Sudheer Satyanarayana shows how to take a few simple lines of code (seven to be exact) and create a simple XML/RSS reader he used to pull in weather data for a simple application.

Today, I was looking for a quick way to get the current weather information on my computer. There are so many websites out there that offer the information. But I was looking for a program I could permanently install on my computer and launch it whenever I want to lookup the weather information. [...] I wrote a program to print the weather information in 7 lines of PHP code. I have published this program on Code Album github repository. You can grab it and use it.

He chose a Yahoo feed to get the weather information from their service. He includes the base code to make the request via a cURL connection and parsing it into a SimpleXML object to pull out the needed info.

tagged: xml rss curl tutorial weather

Link:

Komunitasweb.com:
Showing the weather with PHP and Google Weather API
Sep 11, 2009 @ 14:47:21

On the Komunitasweb.com blog there's a recent post walking you through the steps to add the Google weather content to your site, complete with icons.

If you need to show weather in your website, you can use weather widget such as weatherbug. It’s nice and simple, but maybe you need something more integrated with your website. So, take a look at Google Weather API.

They use a SimpleXML object to pull in the XML data from Google's backend (as called via a URL) and loop through the resulting objects to output temperature, current conditions and several days of the forecast.

tagged: weather tutorial google simplexml api

Link:

CSS-Tricks.com:
Using Weather Data to Change Your Website’s Appearance through PHP and CSS
Feb 18, 2009 @ 18:08:03

On the CSS-Tricks.com site today there's a quick tutorial on changing up the look and feel of your site based on an external source. More specifically, they give the example of updating the graphics of your site depending on the weather in your area via PHP and CSS.

Using a little magic and trickery (read: PHP and CSS), we can change the appearance of a website automatically based on the weather outside, in real time! In the example site we have created, the header graphic will change to one of four different styles based on Sunny, Rain, Snow, and Cloudy.

Their example makes a request to the Yahoo! weather data for a location and brings it in to PHP where the XML is parsed (via a regular expression) and the current conditions are parsed out. This condition is then passed out into the page as the class type on the header and, based on the CSS already defined, the correct image is pulled in as the background.

tagged: weather data yahoo change header css graphic external source

Link:

Stoyan Stefanov's Blog:
Really simple Really Simple Syndication syndication
Jun 07, 2007 @ 12:06:07

On PHPied.com, Stoyan Stefanov shows how, via a simple bit of code (using some SimpleXML) he replaced the javascript widgets he was previously using for weather information.

So it was time for a change, since those buttons were generated by some javascripts, hosted by theweathernetwork, which is kind of a web 1.0 way of sharing content. In the days of APIs and stuff, this is a shame.

He dropped theweathernetwork.com's information and went for something a little more API-friendly - the weather feeds that Yahoo! offers. Once he figured out the right URL parameter to pass for the cities, it was just a matter of whipping up a 30 line script (using SimpleXML) to grab the weather information for the city and echo out the data.

tagged: syndication simple simplexml feed yahoo weather syndication simple simplexml feed yahoo weather

Link:

Stoyan Stefanov's Blog:
Really simple Really Simple Syndication syndication
Jun 07, 2007 @ 12:06:07

On PHPied.com, Stoyan Stefanov shows how, via a simple bit of code (using some SimpleXML) he replaced the javascript widgets he was previously using for weather information.

So it was time for a change, since those buttons were generated by some javascripts, hosted by theweathernetwork, which is kind of a web 1.0 way of sharing content. In the days of APIs and stuff, this is a shame.

He dropped theweathernetwork.com's information and went for something a little more API-friendly - the weather feeds that Yahoo! offers. Once he figured out the right URL parameter to pass for the cities, it was just a matter of whipping up a 30 line script (using SimpleXML) to grab the weather information for the city and echo out the data.

tagged: syndication simple simplexml feed yahoo weather syndication simple simplexml feed yahoo weather

Link:

Community News:
Web APIs with PHP Book Released
Aug 28, 2006 @ 18:13:00

It's the book everyone's talking about and the entire PHP community should by! Okay, really, there's a few blog posts about it, but it's definitely not one to pass up if you need a quality recource on using web APIs in PHP - Paul Reinheimer's "Professional Web APIs with PHP: eBay, Google, Paypal, Amazon, FedEx plus Web Feeds".

Chris Shiflett comments on his blog that, though he hasn't read it yet:

I know Paul has been working on it for well over a year, and it has already received a positive review from Nathan Smith.

The review gives praise to the book, noting that it provides good examples and helpful tutorials for each of the APIs talked about. The book covers its subject well without trying to "spread itself too thin" by including too much and not focusing on its core - APIs like eBay, Google, FedEx, Flickr, even the National Weather Service.

Even Paul himself comments on the occasion, mentioning what his intentions for the book were and how it changed along the way.

tagged: book release web api google ebay weather flicker review book release web api google ebay weather flicker review

Link:


Trending Topics: