Twitter counter no longer works

Since 20 of November 2015 the twitter button has changed. This is the new Twitter sharing button, as you can see there isn’t the tweets counter: Since 20 of November the old and private endpoint that were used by the official Twitter social button at the url http://urls.api.twitter.com/1/urls/count.json no longer works. This means that you […]

Scraping content with PHP as if it was jQuery

Building a spider or a bot needs some knowledge of regular expressions, you must know and use preg_match or preg_match_all to selectively find tags and extract informations from the html source. Sometimes, while I was watching the html code of a page, I’ve been thinking “If I could only use jQuery to get it! It […]

Get instagram data without official api in PHP

Instagram has an official API to interact with its database of images and users. If you have enough time to understand oAuth protocol and build a bunch of functions to deal with instagram API, that’s the best way… But if you need just a minimal integration and you need to go fast, probably it’s enough […]

Make a cron job with IFTTT

Cron is a software utility, a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs to run periodically at fixed times or dates. Sometimes, as a developer, I don’t have access to the server at a deep level and, for example on some […]

How to read facebook likes count from PHP

When you add facebook like button to your site, probably, you also want to save the number of likes of your pages to your database.These data are very useful and very important because they tell you which of your articles are better than others. Moreover, these pages are better than others because the user has […]

PHP code to check if remote mp3 exists

Hi, I’ve a big table with thousands of mp3 links. Sice these links come from an old database, many of them are old and expired. Here is a function that I’ve included in my Minibots Class. The function uses checkdnsrr to verify the domain and then uses curl to fetch the mp3 file and verify […]

How to use Instagr.am photos on your site

UPDATE: 2013-12-04 I’ve made a method in the Mini Bots PHP Class that lets you retrieve images from instagram without the official api and without using Followgram as written here. The question is: how can I bring my instagram photos on my personal web site? With this tutorial you can make this. I’m addicted to […]

get MySpace events with a PHP function

Here is a function to read the concerts for a myspace band page. This code retrieves the “shows page” for a specified myspace username, and than parse the html to find and decode data. Since myspace returns a page in Italian (this probably depends on geographic ip translations) the fnction uses a months array in […]

PHP Geocoding function, from address to coordinates lat long

This is a small function included in the Minibots Class that converts an address to a couple of coordinates Latitude, Longitude that can be used to place a marker on a map. This function uses Google’s geocoding service called with the file_get_contents function (CURL not needed). The result is decoded with a preg_match call that […]