Posts

Showing posts from September, 2017

How to post pictures to instagram using API - php

Instagram are now banning accounts and removing the images based on this method. Please use with caution It seems that everyone who has answered this question with something along the lines of it can't be done is somewhat correct. Officially, you cannot post a photo to Instagram with their API. However, if you reverse engineer the API, you can. function SendRequest ( $url , $post , $post_data , $user_agent , $cookies ) { $ch = curl_init (); curl_setopt ( $ch , CURLOPT_URL , 'https://i.instagram.com/api/v1/' . $url ); curl_setopt ( $ch , CURLOPT_USERAGENT , $user_agent ); curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , true ); curl_setopt ( $ch , CURLOPT_FOLLOWLOCATION , true ); if ( $post ) { curl_setopt ( $ch , CURLOPT_POST , true ); curl_setopt ( $ch , CURLOPT_POSTFIELDS , $post_data ); } if ( $cookies ) { curl_setopt ( $ch , CURLOPT_COOKIEFILE , 'cookies.txt' ); ...

How to run PHP Scripts with crontab?

Lots of programmers like PHP for its ability to code and develop web applications fast. Well, this programming language was built for web. Today we want to cover another topic many developers are puzzled about, “ How to run PHP Scripts with crontab? ” Cron is normally available on all Unix and Linux distributions; if you cannot access it, contact your root or server administrator. It is a daemon which allows you to schedule a program or script for a specific time of execution. If you want to learn more about cron, click here or type “man crontab” at your command prompt. I have found myself in the need to run PHP scripts at specific times. For example, to update the content of a website, to remove expired articles, to send out e-mails on a given date and a lot more. While some may think that this is were PHP is doomed, I will show you how it’s done. A Manual crontab? The first solution that came to my mind was to run the script directly from my browser (e.g. entering www...