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

SitePoint PHP Blog:
Powerful Custom Entities with the Diffbot PHP Client
Nov 02, 2015 @ 16:55:18

On the SitePoint PHP blog editor Bruno Skvorc continues his look at the Diffbot service and shows how to use their API to create entities representing objects from the API data.

A while back, we looked at Diffbot, the machine learning AI for processing web pages, as a means to extract SitePoint author portfolios. [...] Since then, the design of the pages we processed has changed, and thus the API no longer reliably works. In this tutorial, apart from rebuilding the API so that it works again, we’ll use the official Diffbot client to build custom entities that correspond to the data we seek (author portfolios).

He starts by setting up the environment for development (a Homestead Improved instance) and pulling in a few libraries to bootstrap the script. He shows the setup and configuration of the Diffbot client, creating a new API application via their UI and using the browser tools to help the service locate the information it needs. He then shows how to extend the client and define an "entity factory" to generate the objects requested. In this case he creates an AuthorFolio class to contain the author's number of posts.

tagged: diffbot client custom entities tutorial author portfolio api

Link: http://www.sitepoint.com/powerful-custom-entities-with-the-diffbot-php-client/

Sasa Stamenkovic's Blog:
Create Kick-ass Website in no Time with Silex
Jul 27, 2011 @ 17:02:38

Sasa Stamenkovic has a quick post to his blog talking about a switch he made away from the Zend Framework over to Silex for a simple portfolio site.

Last week I needed a small website. I wanted it to be quick and dirty. Well, blazing fast and not so dirty. I heard best about Silex, so I gave it a shot. It was more then good experience. It worked like a charm, it was fun to use and site was completed in one day.

He includes two code snippets - one is the basic "hello world" example that most Silex tutorials reference and the other is more specific to his site. It defines the routes and the (Twig) templates they relate to. A few submodules helped him get this and other functionality working (like the Forms component and Swiftmailer for a contact form). You can find the full source for the site over on github.

tagged: silex website portfolio example github

Link:


Trending Topics: