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 […]

Block junk emails, spammers and temporary emails

If you need an Email Validator Function, consider this version that includes also the check against common temporary mail services which should be blocked, since their emails work only for some minutes. Temporary emails services are web sites that let you open an anonymous email account that works only for a session. They are used […]

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 […]

User agent detect with PHP

Small PHP code snippet to make a quick detect if the browser that requests your page is on a mobile device. If it’s a mobile device (that is to say an iphone, an ipad, an android or a blackberry) returns the $device variable. Else it returns false.