mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 12:11:05 -05:00
Get header out
This commit is contained in:
@@ -32,7 +32,7 @@ then
|
|||||||
test "$2" && since='&max_id='$(tail -n1 $1.txt | cut -d'|' -f1) # use max_id to get older tweets
|
test "$2" && since='&max_id='$(tail -n1 $1.txt | cut -d'|' -f1) # use max_id to get older tweets
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while urlargs="screen_name=${1}&count=200&page=${page}${since}&include_rts=1&trim_user=0&include_entities=1"; echo $urlargs; ./oauth.php $urlargs | json -d '|' -a id created_at text > $temp2; test $(wc -l < $temp2) -gt 0;
|
while urlargs="screen_name=${1}&count=200&page=${page}${since}&include_rts=1&trim_user=0&include_entities=1"; echo $urlargs; $(dirname $0)/oauth.php $urlargs | json -d '|' -a id created_at text > $temp2; test $(wc -l < $temp2) -gt 0;
|
||||||
do
|
do
|
||||||
|
|
||||||
#cat temp2
|
#cat temp2
|
||||||
|
|||||||
18
oauth.php
18
oauth.php
@@ -45,18 +45,22 @@ $oauth['oauth_signature'] = $oauth_signature;
|
|||||||
|
|
||||||
// Make Requests
|
// Make Requests
|
||||||
$header = array(buildAuthorizationHeader($oauth), 'Expect:');
|
$header = array(buildAuthorizationHeader($oauth), 'Expect:');
|
||||||
$options = array( CURLOPT_HTTPHEADER => $header,
|
|
||||||
//CURLOPT_POSTFIELDS => $postfields,
|
|
||||||
CURLOPT_HEADER => false,
|
|
||||||
CURLOPT_URL => $url . '?'. $urlargs,
|
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
CURLOPT_SSL_VERIFYPEER => false);
|
|
||||||
|
|
||||||
$feed = curl_init();
|
$feed = curl_init();
|
||||||
|
$options = array( CURLOPT_HTTPHEADER => $header,
|
||||||
|
CURLOPT_URL => $url . '?'. $urlargs,
|
||||||
|
CURLOPT_HEADER => true,
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_SSL_VERIFYPEER => false);
|
||||||
|
|
||||||
curl_setopt_array($feed, $options);
|
curl_setopt_array($feed, $options);
|
||||||
$json = curl_exec($feed);
|
$content = curl_exec($feed);
|
||||||
|
list($header, $json) = explode("\r\n\r\n", $content, 2);
|
||||||
curl_close($feed);
|
curl_close($feed);
|
||||||
|
|
||||||
|
file_put_contents('php://stderr', $header . "\n\n");
|
||||||
|
|
||||||
// No results returned, Twitter API issue
|
// No results returned, Twitter API issue
|
||||||
if (strlen($json) == 2) { exit(1); };
|
if (strlen($json) == 2) { exit(1); };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user