Viraj Khatavkar, Nov 26

How to Properly Deploy Web Apps via SFTP with Git

Viraj demonstrates the full process of writing custom code for deploying different commits of your app to an SFTP server using Git and PhpSecLib
Younes Rafie, Nov 16

Quick Tip: The Convenient Magic of Eloquent Observers

Younes presents Eloquent Observers - a method of subscribing to changed on models and having those models notify all subscribers of changes. Check it out!
Wern Ancheta, Nov 11

Amazon Product API Exploration: Let's Build a Product Searcher

Wern Ancheta develops a product search API for Amazon products with Amazon Products Advertisement API
Younes Rafie, Nov 06

Extending OctoberCMS - Building a Soft-Delete Plugin

Younes extends OctoberCMS by building a soft-delete plugin, allowing you to delete posts by marking them as trashed, while still keeping them in the DB!
Wern Ancheta, Nov 03

Build Your Own Dropbox Client with the Dropbox API

Wern shows us how to use Laravel and Guzzle to build our own full Dropbox client with the Dropbox API!
Wern Ancheta, Oct 26

Shopify App Development Made Simple with HTTP APIs and Guzzle

Wern shows us how easy it is to get stared with developing Shopify powered PHP apps with Guzzle and Shopify's HTTP API.
Christopher Pitt, Oct 18

Modding Minecraft with PHP - Buildings from Code!

Chris shows us how we can connect PHP to Minecraft in a way that lets us create terrains and buildings from PHP code!
Wern Ancheta, Oct 13

Picking the Brains of Your Customers with Microsoft's Text Analytics

Wern develops an app which uses Microsoft's Text Analytics API to recognize positive or negative sentiment in people's reviews of an Amazon product.
Bruno Skvorc, Sep 29

Fighting Recruiter Spam with PHP - Proof of Concept

Connecting to IMAP and SMTP from PHP in order to filter, identify, and reply to recruiter spam - the inbox blight of any decent developer!
Reza Lavaryan, Sep 12

RESTful Remote Object Proxies with ProxyManager

What are proxies? How can we use them? And what kind of advanced use cases can we think of? Let's perform some RESTful remote miracles with ProxyManager!
Bruno Skvorc, Aug 28

Sourcehunt 2016.8 - Contribute to Regression, Regex, ORMs, and More

This sourcehunt we're featuring packages dealing with regex, hardcore math, mini-CMS, ORMs, and more! Come get your Github contributions going!
Wern Ancheta, Aug 26

How to Create a Pokemon Spawn Locations Recorder with CouchDB

Wern Ancheta shows you how to build a Pokemon spawn location recorder app with CouchDB and the Slim Framework, wrapping it up in good security practices!
Bruno Skvorc, Aug 19

Quick Tip: Solution to Paypal IPN Always Returning "Invalid"

A solution to the PayPal IPN Simulator "INVALID" problem - where the verification message always returns invalid, even if everything seems fine
Wern Ancheta, Aug 11

A Pokemon Crash Course on CouchDB

Wern Ancheta takes us through a practical crash course into using CouchDB - CRUD, configuration, cooperation with PHP, and more!
Bruno Skvorc, Aug 08

6 More Must-Do Grav Tweaks: Ready for Hacker News Traffic!

Super-caching, optimization, customization, comments, and much more you simply MUST do for your Grav installation
Wern Ancheta, Jul 22

Can We Use Laravel to Build a Custom Google Drive UI?

Wern Ancheta builds a brand new Google Drive admin UI with Laravel!
Andrew Carter, Jul 09

Powering Raspberry Pi Projects with PHP

Andrew Carter makes an LED blink on a Raspberry Pi with PHP - Building Raspberry Pi projects with PHP has never been easier!
Christopher Pitt, Jul 08

PHP, Arduino, And... Minecraft? Connecting an Arduino to PHP!

Chris connects an Arduino to PHP and reads the log output to signal a LED on a certain condition, completing the real world Minecraft door-alarm
Christopher Pitt, Jul 06

PHP, Arduino And... Minecraft? Combining Minecraft with PHP!

Chris Pitt combines Minecraft and PHP to prime the ground for an Arduino implementation, culminating in a real world alarm for a Minecraft door!
Bruno Skvorc, Jul 04

Do PHP and IoT Have a Future Together?

Our intro post to the world of IoT and PHP - a list of resources to get started with, and sites to buy electronic components from!
Daniel Berman, Jun 08

Monitoring WordPress Apps with the ELK Stack

Daniel shows us how we can apply the ELK stack to WordPress for advanced monitoring and error logging - never stare at confusing logs again!
Christopher Pitt, Jun 03

Hacking the Fitbit - Emulating a Pager for Twitter DMs!

Chris makes his cheap Fitbit vibrate on new Twitter DMs - emulated pager AND a silent wake-up alarm? WIN!
Wern Ancheta, May 13

We're Building a Marvel Catalog Reader! Avengers, Assemble!

In this tutorial, we're going to take a look at the Marvel API, a tool provided by Marvel for developers to get access to the 70-plus years of Marvel comics data.

Marvel logo

First, we'll walk through the steps in which one can acquire the keys needed to make requests to the API. Then, we'll look at the tools we can use to test out the API. Finally, we're going to build a website that uses the API.

Signing Up

The first thing we need to do is go to the Marvel Developer Website and click the Get a Key link. We'll then be provided with the public and private key which we can use to perform requests to the API. If you plan to use the project in production, you can also add your website's domain name to the list of authorized referrers. This provides a security layer in case you accidentally push your public and private keys to Github.

Important Notes Regarding the Use of the API

For limits and rules, please see the attribution, linking and rate limits page of their documentation. Also be sure to read the Marvel API Terms of Use if you're planning to use the API in production. I've summarized it below:

  • Beware of the API rate limit. At the time of writing of this tutorial the rate limit is 3000 calls per day. That's applicable to all the endpoints.
  • Always attribute Marvel as the source when displaying API data and images. Marvel recommends the use of this text: Data provided by Marvel. © 2016 Marvel.

Playing with the API

The API comes with an interactive documentation which allows you to easily test all the available API endpoints.

There's information on the data one can expect:

expected data

... text fields to specify the different parameters to be submitted for the request:


... error status codes:

error codes

... the request URL, response body, response code and the response headers:

request and response

Do note that the request URL won't actually return anything if you access it outside of the API testing tool. This is because it lacks the required parameters for the request. At the bare minimum, you'll have to supply the public key, the current unix timestamp, and an md5 hash of the timestamp, and private and public key combined.

$ts = time();
$public_key = 'your public key';
$private_key = 'your private key';
$hash = md5($ts . $private_key . $public_key);

Once you have those, only then can you perform a request to the API:

$query_params = [
    'apikey' => $public_key,
    'ts' => $ts,
    'hash' => $hash

//convert array into query parameters
$query = http_build_query($query_params);

//make the request
$response = file_get_contents('http://gateway.marvel.com/v1/public/comics?' . $query);

//convert the json string to an array
$response_data = json_decode($response, true);

We'll take a look at this in more detail when we get to the section where we start making requests for the app that we'll be building.

Daniel Berman, May 11

How to Process Server Logs

Daniel Berman explains what the ELK stack is, how to install it, and how to make it analyze the logs of the typical LAMP stack