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

Laravel News:
Learn to Create an RSS Feed from Scratch in Laravel
Apr 04, 2018 @ 15:47:52

On the Laravel News site there's a new tutorial showing you how to easily create an RSS feed with Laravel and the help of the spatie/laravel-feed package.

Creating an RSS feed in Laravel isn’t the most challenging task, but using a package and a few tips can help you create an RSS feed relatively quick.

We are going to use the spatie/laravel-feed package to walk through going from a brand new Laravel 5.6 project to serving RSS feeds.

The tutorial then goes through each step along the way, providing code and commands to get you up and running:

  • Setting up a new Laravel project
  • Modeling the data
  • Setting up the (event) model
  • Creating the Routes and the Events Controller
  • Linking to the feed

The result is a simple RSS feed that can be linked to from a link tag in your site and provide a list of upcoming events.

tagged: laravel tutorial rss feed spatie package

Link: https://laravel-news.com/learn-to-create-an-rss-feeds-from-scratch-in-laravel

Laravel News:
Generate a JSON Feed with Laravel
May 24, 2017 @ 15:49:46

In a new tutorial posted to the Laravel News site Eric Barnes shows you how to easily create JSON feed output from the data in a Laravel application. JSON feed is a new standard that's been defined to try to bring more structure to JSON responses for feeds, following in the tradition of RSS feed structure.

JSON Feed is a new standard to formalize a JSON based RSS feed that aims to simplify creating feeds by doing away with the XML standard. Implementing a feed for your site is simple, and the spec is surprisingly clear.

[...] I just implemented this feed format for Laravel News, and you can find the results here. As a quick example let’s go through setting up a feed like this.

He then walks you through the code required to create the feed, sharing a listing of posts (the latest 20) from the Laravel News site. He then defines the main feed data, adds in each of the posts to the "items" set and returns the resulting array for translation into JSON output.

tagged: jsonfeed standard laravel tutorial output json feed

Link: https://laravel-news.com/generate-a-json-feed-with-laravel

Zend Framework Blog:
Create RSS and Atom Feeds
Apr 13, 2017 @ 17:47:01

In a previous post to the Zend Framework blog Matthew Weier O'Phinney talked about parsing feeds with Zend Framework components. In this latest post they cover the other half of the equation - creating RSS and Atom feeds using some of the same components.

In our previous article on zend-feed, we detailed RSS and Atom feed discovery and parsing. Today, we're going to cover its complement: feed creation!

zend-feed provides the ability to create both Atom 1.0 and RSS 2.0 feeds, and even supports custom extensions during feed generation. [...] You can also provide your own custom extensions if desired; these are just what we ship out of the box! In many cases, you don't even need to know about the extensions, as zend-feed will take care of adding in those that are required, based on the data you provide in the feed and entries.

He then shows how to pull in the zendframework/zend-feed component and how to use it to create a simple RSS feed with a title, link, description and "feed link". He then shows how to add new items to the feed (with details for each item) and how to render the resulting feed.

tagged: zendframework tutorial create rss atom feed component

Link: https://framework.zend.com/blog/2017-04-13-zend-feed-writing.html

Zend Framework Blog:
Discover and Read RSS and Atom Feeds
Apr 07, 2017 @ 14:25:08

On the Zend Framework blog Matthew Weier O'Phinney has written up a new tutorial showing you how to discover and read RSS feeds with the help of the zend-feed component of the Zend Framework.

Remember RSS and Atom feeds? Chances are, you may be reading this because it was on a feed.

[...] An interesting fact: Atom itself is often used as a data transfer format for REST services, particularly content management platforms! As such, being familiar with feeds and having tools to work with them is an important skill for a web developer! In this first of a two part series on feeds, we'll look at feed discovery, as well as reading, using zend-feed's Reader subcomponent.

He gets started by installing the zendframework/zend-feed component with Composer and pulling in the zendframework/zend-http component to make the HTTP requests for the feeds. He then shares some code that helps with RSS/Atom feed discovery on a site and viewing the results. This list is then used as sources to import and code is shown that outputs the basic information about the feed. Finally he shows how to look through the entries in the feed and output the title, link and description of each.

tagged: series discover read parse rss atom feed zendframework zendfeed zendhttp tutorial part1

Link: https://framework.zend.com/blog/2017-04-06-zend-feed-reading.html

Master Zend Framework:
How to view an Instagram Photo Stream in Zend Framework 2
Jul 09, 2014 @ 15:53:59

On the Master Zend Framework site Matthew Setter has a new tutorial showing how to pull in Instagram photo feeds in a Zend Framework 2 application via their on developer functionality.

In today’s tutorial, we’re going to learn how to retrieve and display an Instagram photo stream in Zend Framework 2. We’re going to cover the essentials of adding the libraries we’ll need to composer.json, handling authentication and then retrieving and displaying our photo stream in a controller action. We’ll be doing all of this by using composer to create a new Zend Framework 2 project, based on the ZF2 Skeleton App project and then add a new controller and action which will handle the work involved.

The tutorial uses a basic skeleton application and a PHP Instagram library to make the connection to their API. He shows you how to register your application with Instagram and set up the OAuth configuration to handle the authorization process. He walks you through the creation of the controller, setup of session support and the creation of a "photosAction" to view the results of the photo feed pull. He includes a screenshot of what the end result should look like with it all up and working.

tagged: zendframework2 tutorial instagram photo feed api

Link: http://www.masterzendframework.com/api/view-instagram-photo-stream

Tech.pro:
How to Create an RSS Feed Using PHP and PDO
Dec 04, 2013 @ 17:52:53

On the tech.pro site there's a recent tutorial posted showing you a basic way to create an RSS feed using data coming from a database accessed via PDO.

Using an RSS feed on your website is a great way of letting your visitors, search engines or directories get a hand on your content. RSS feeds are common practice on most blog and CMS platforms including Wordpress, Joomla and evenly the newly released Ghost. If you're using a CMS or similar platform, the likelihood is that you don't need to implement an RSS feed yourself. [...] Below you've got the step-by-step process to create anything from the simple, standard-compliant RSS feed - up to the more advanced.

The tutorial shows you how to pull the data from a simple database table (SQL not provided, but pretty easy to figure out(, including example PDO connections for several database types. This data is then manually appended into an XML string to build out the RSS feed correctly. They also talk about implementing the Dublin Core metadata as a way for providing more information about the feed and its contents (including an image and category details).

tagged: rss feed introduction tutorial pdo xml dublincore

Link: http://tech.pro/tutorial/1722/how-to-create-an-rss-feed-using-php-and-pdo

Symfony Blog:
Symfony Website Updates
Oct 04, 2013 @ 14:05:44

On the Symfony project's blog today there's a new post from Fabien Potencier talking about some updates that have been made to the Symfony website.

There's a few things that got an update including:

  • Translations that were added to the main site
  • A method of aggregation for Symfony-related blogs
  • A Roadmap notification system that lets you set up email notifications on major roadmap changes and releases.

They're still working on the translations, but if you'd like to help you can contribute to their github repository.

tagged: symfony website update translation planet feed roadmap notification

Link: http://symfony.com/blog/symfony-website-updates

PHPMaster.com:
Create a Podcast Feed with PHP
Aug 14, 2013 @ 16:54:48

On PHPMaster.com there's a tutorial posted that walks you through the creation of a podcast feed based around a Slim framework application and this skeleton application.

In this article, I’ll demonstrate how to use PHP to generate a podcast feed. We’ll create a simple administrative interface to configure the podcast metadata, add and list episodes, and then go through the generation of the podcast feed itself (which is simply an RSS document).

He walks you through the full process - setting up the application, creating the various management pages and making the associated views to add more information to the feed. He also includes the code/markup you'll need for adding episodes and generating the actual XML RSS feed output. You can download the full app if you want to see how it's all laid out.

tagged: podcast tutorial feed id3 tag slim framework rss

Link: http://phpmaster.com/create-a-podcast-feed-with-php

Pádraic Brady:
Publishing Security Disclosures In Consumable Formats
May 16, 2013 @ 14:03:59

Pádraic Brady has a new post today proposing that what the PHP ecosystem needs is a way to better publish security disclosures in a format that's easy to parse and deal with.

This is a branch off from a separate discussion on the PHP-FIG mailing list about other ways the Framework Interoperability Group can encourage and foster wider interoperability among its member projects (and by extension, the whole PHP community). I’ll start by noting two interesting developments in recent months and one long standing best practice.

The two "interesting developments" he mentions are the relatively recently released SensioLabs Security Checker that uses you Composer file to find security issues and the new entry in the latest version of the OWASP Top 10 list for "Using Components with Known Vulnerabilities". The best practice he talks about is more around the timely/responsible disclosure of vulnerabilities and how some kind of decentralized tracking of these issues that puts the responsibility back on the developers of the tool and not on one tracking resource.

tagged: security disclosure feed proposal sensiolabs checker owasp

Link: http://blog.astrumfutura.com/2013/05/publishing-security-disclosures-in-consumable-formats-for-simpler-aggregation-and-security-checking

PHPMaster.com:
Consuming Feeds with SimplePie
Apr 22, 2013 @ 16:47:50

In a recent post to PHPMaster.com Kevin Mowry shows you how to use SimplePie, a simple to use programatic feed reader you can use to parse things like RSS feeds.

If you’re an avid feed consumer like I am, you might be a bit sad to see Google’s recent announcement of Reader reaching end of life. Reader was simple and easy to use, but there’s no reason you can’t have the same functionality with your own homegrown project. The PHP library SimplePie allows for quick and easy feed consumption and display. Here’s how you can get started on your own feed reader.

He helps you get it installed (via Composer) and shows you how to use some of its most basic functionality to parse the New York Times' feed. He also includes examples of getting the information back out of the SimplePie object. There's also some snippets that show how to only get the latest items and how to cache the results.

tagged: simplepie rss feed reader tutorial nytimes

Link: http://phpmaster.com/consuming-feeds-with-simplepie


Trending Topics: