comparison default/assets/vendors/theme-widgets/getTwitterFeed.php @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 <?php
2 require "vendor/autoload.php";
3 require "api_info.php";
4 use Abraham\TwitterOAuth\TwitterOAuth;
5
6 $queryArr = [
7 "screen_name" => "envato",
8 "count" => 3,
9 ];
10
11 $getArr = $_GET;
12 $queryArr = array_merge( $queryArr, $getArr );
13
14 $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_KEY_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
15 $content = $connection->get("account/verify_credentials");
16 $statuses = $connection->get("statuses/user_timeline", $queryArr);
17
18 header('Content-Type: text/json');
19 echo json_encode($statuses);
20