How to auto publish post on Instagram Page with PHP/cURL and without using Instagram API (1) - Single Product Manual Posting

instagram , auto update , auto login

Instagram is one of the most difficult apps for developers to schedule auto posting without using API. Instagram is specifically designed to support uploads from mobile phones only. Instagram team only gives whitelist access to limited  third-party apps for automatic posting on a case by case basis. Another reason is Instagram team want to fight spam and low quality photos.

I was looking for a way to auto posting from website to Instagram page using PHP/cURL without using API since last two years. Lately I found two websites that are discussing about this topic.

Posting a Photo to Instagram Without a Phone


Initially I was not able to make the coding working immediately after download the source files due to several issues such as PHP 5.5 vs 5.6 issue as well as new signature key from instagram app. In this tutorial, I will show you a working draft to auto post single photo to Instagram page using PHP/cURL. I am take no responsibility if your account banned by Instagram. :) [...]

Read more 0

New and Updated! Facebook Remote Status Update with PHP/cURL Bot

Facebook , auto login , auto update , login form , cURL
Mobile Facebook Login Page

I published "Facebook Remote Status Update with PHP/cURL Bot" in Feb 4 2014. The script was working well until early this year. I received comments and emails that script no longer working and requested an update. So here I try to find out any changes to Facebook login form and status update.

In summary, the login portion still working fine. However, Facebook has converted status update form into unicode format as well as one of the key value in the status update form. In fact, just need to change one line of my old script to continue our facebook autologin and status update. [...]


How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (4) - Integrate with Opencart

Facebook , PHP SDK V4 , Graph API v22 , auto update

In the last part of this article, I am going to show you a simple example how to integrate the Facebook PHP SDK and Graph API into Opencart and auto publish products to Facebook Page. The example is a simplified version of my own script. You might want to modify this script on your shopping cart.

This script will randomly pick one of the published product from Opencart MySQL database and use the code in previous article for auto posting. By running the script under crob tab four times a day, for example, there are four product published everyday. 

This script is tested on Opencart

Here is the sample code to do that: [...]


How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (3) - Single Product Manual Posting

Facebook , PHP SDK V4 , Graph API v22 , auto update

Facebook Auto Posting

After setting up Facebook App and getting a permanent Page Access Token, we now write a simple code to post a product to Facebook page. We need to download facebook PHP SDK v4 from github. You can get the file from here. Unzip the file and go to directory "Facebook". You can upload this directory to your server. 

Since v4.0.9, Facebook PHP SDK v4 come with autoloader, we don't have to use Composer (Dependency Manager for PHP). For the file downloaded just now, there is a file call "autoloader.php" before "src" directory. In my case, I moved this file into Facebook directory as well. 

Here is the code: [...]


How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (2) - Get Permanent Page Access Token

Facebook , PHP SDK V4 , auto update , Graph API v22

Graph API Explorer

There are various types of access token for facebook app. The best article that explains them is How to handle access tokens with Facebook SDK v4.0 by Sammy Kaye. To post article / item / product from our own website to facebook fan page, we need to use Page Access Token.

The initial token can be obtained from Facebook Graph API tool. However, that is just a short-lived access token, which will expire in an hour or two after generation. We need to made a Graph API call to get a long-lived access token, which has two months expiry date. Lastly, get a permanent access token, which will never expire and can be used in our daily script.

We can test our script using short-lived access token, but then you have to regenerate another token after expiration. So we should directly get permanent access token before writing our script. [...]

Read more 9

How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (1) - Create Facebook App

Facebook , PHP SDK V4 , auto update , Graph API v22

Facebook Developers

I have a ecommerce webstore using OpenCart with around 2000 products. I have created twitter, goolge+, pinterest and facebook page for this website. With Google moving towards semantic search, all these social signals are increasingly important. Everyday, I have to select one or two products and post on these social media websites. I don't like to do this manually and need to find ways to let a script doing the posting. For facebook page, I can use the APIs for daily auto posting. 

When I search for "Facebook PHP SDK for auto posting", there are lots of confusing results, mainly due to code written in different Facebook SDK versions. The documentation from Facebook developers website also quite difficult to understand. However, after reading articles from many websites, trial and error with example codes, finally I am able to do auto posting with Facebook PHP SDK v4 and Graph API v2.2.

Here's my expectations:

1) I want to auto post to Facebook Fan Page as admin.

2) No Login with Facebook required.

3) I want to post product title, product url, and product image, just like normal posting.

4) With 2000++ product listing and still increasing, I want able to auto post three to five items per day. It will take more that one year to post all products from my website. 

In part 1 of this article, I will describe how I set up facebook app. In the next article, I will describe the code used to auto post single item to facebook page. [...]

Read more 0

Price Comparison Engine using SphinxSearch

Price Comparison Engine , Sphinx Search , PHP , Web Crawler

Sphinx Search Server

My last article was written in Feb this year. I was extremely busy on my internet retail business in the last eight months, as well as putting a lot of effort to release a price comparison engine for Malaysia's ecommerce market, Bijak Mall collects product information from various internet malls in Malaysia and indexes into database. Potential buyers then able to search and compare prices through Bijak Mall's search engine. I started this project under XAMPP environment so that I can use my laptop to test the scripts. I wrote web spiders in PHP to collect products' data and store into MySQL database. Sphinx Search Server (Windows version) is used to index the database and response to user query. Sphinx is a free software/open source Fulltext search engine designed to provide full-text search functionality to client applications. [...]

Read more 0

Facebook Remote Status Update with PHP/cURL Bot

Facebook , auto login , auto update , login form , cURL

Facebook login form

** The script in this post no longer working properly. I have updated the script and posted at New and Updated! Facebook Remote Status Update with PHP/cURL Bot  **


In previous posts, the discussion is mainly focus on getting web page source file and perform scraping to the text file. In this post, I will show you how I use PHP/cURL to login into Facebook account and post status update at Facebook wall. Once we know how to remote posting using PHP/cURL, we can do many things such as auto posting comment into forum or blog, fill up contact form and send email to our target, login to website and pull out information we need.

For this test case, I am using XAMPP in the PC and login to Facebook mobile interface which is much simpler than its desktop version. You can try to compare Facebook login source file for both desktop and mobile version.

From the browser, go to and there is only one login form. [...]


The Art of Invisibility for Ninja Web Spider

captcha , cpanel , user agent , proxy , invisibility

Art of Invisibility

Most webmasters welcome webbot from search engines such as Google and Bing. Contents of their websites will be indexed by search engines and users can easily find thier websites. However, they surely not welcome your web spider to extract data from their sites, may be you're up to no good, such as how products from were used to drive traffic to a Hong Kong website. Most likely your IP will be blocked if webmasters detect unknown web spider aggressively crawling their websites. Way back to 2001, eBay filed legal action against Bidder's Edge, an auction scraping site, for “deep linking” into its listings and bombarding its service; Craigslist has throttle mechanism to prevent web crawlers from overwhelming the site with requests

Even big spiders like Google has mechanism to prevent others from scraping their content. Try to search a keyword and at the results page, click page 1, then page 2, page 3,...At page 20 (in my case), Google will stop displaying search results and want to find out are you a human or webbot that reading the page. If you unable enter correct captcha, then your IP will be blocked eventually. [...]

Read more 0

Most Viewed Articles

Get IPVanish VPN Today!!