Skip to content

Commit

Permalink
Merge branch 'feature/cleanup' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
scottlimmer committed Jun 13, 2022
2 parents b74bb8a + 7980a64 commit 1cfb3d5
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 283 deletions.
39 changes: 2 additions & 37 deletions cron/twitter.cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
* Time: 4:37 PM
*/

const TWITTER_BEARER_TOKEN = 'AAAAAAAAAAAAAAAAAAAAAAEe9gAAAAAAyXXvW1LhcVRB1fCvIAUzExbDfAA%3DhQCppugfuFBDr0qgGsgK6GTPgVYI8uR2DTs3MITOcMRXVONTlT';
const TWITTER_USER = 'vwsg_web';
const TWITTER_API_URL = 'https://api.twitter.com/1.1/';

require_once __DIR__ . '/../../../../wp-twitter-config.php';

$ch = curl_init(
sprintf(
Expand All @@ -20,7 +17,6 @@
'screen_name' => TWITTER_USER,
'count' => 10,
'exclude_replies' => true,
// 'include_rts' => false,
'trim_user' => true,
'tweet_mode' => 'extended'
])
Expand All @@ -38,35 +34,4 @@
$response = curl_exec($ch);
curl_close($ch);

/*$ids = [];
$response = json_decode($response);
foreach ($response as $tweet) {
$ids[] = $tweet->id;
}
$ch = curl_init(
sprintf(
'%s%s?%s',
TWITTER_API_URL,
'statuses/lookup.json',
http_build_query([
'id' => implode(',', $ids)
])
)
);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
sprintf('Authorization: Bearer %s', TWITTER_BEARER_TOKEN)
]
]);
$response = curl_exec($ch);
curl_close($ch);*/


file_put_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.TWITTER_USER.'.json', $response);
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . TWITTER_USER . '.json', $response);
Loading

0 comments on commit 1cfb3d5

Please sign in to comment.