I am writing an app in php that allows you to assign proxies to accounts.
At the moment, I have the following code to connect to the twitter 1.1 api:
# API OAuth
require_once('twitteroauth.php');
require_once('TwitterAPIExchange.php');
$file = 'cursor.txt';
$url = 'https://api.twitter.com/1.1/followers/ids.json';
$requestMethod = 'GET';
$cursor = (int)file_get_contents($file);
$i = 0;
$twitter = new TwitterAPIExchange($settings);
$exec_time = 0;
while ($cursor != 0 && $i != 3) {
if($i == 2) {
$current = strval($cursor);
file_put_contents($file, $current);
// $i = 0;
}
$getfield = '?screen_name=michaeljackson&cursor=' . $cursor;
$followers_json = $twitter -> setGetfield($getfield)
-> buildOauth($url, $requestMethod)
-> performRequest();
$followers_decoded = json_decode($followers_json);
$to_look_up = array_chunk($followers_decoded->ids, 100);
foreach ($to_look_up as &$idnums) {
$comma_separated = implode(",", $idnums);
echo "\n";
echo $comma_separated;
}
$cursor = $followers_decoded->next_cursor;
$i++;
}
My question is how to perform twitter api 1.1 requests behind a proxy?? All i know is that it might involve curl.