X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fj7mbo%2Ftwitter-api-php%2Findex.php;fp=vendor%2Fj7mbo%2Ftwitter-api-php%2Findex.php;h=ab0f7907482eff62129271dc9c14cafe0c4940c9;hp=0000000000000000000000000000000000000000;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/j7mbo/twitter-api-php/index.php b/vendor/j7mbo/twitter-api-php/index.php new file mode 100755 index 000000000..ab0f79074 --- /dev/null +++ b/vendor/j7mbo/twitter-api-php/index.php @@ -0,0 +1,37 @@ + "", + 'oauth_access_token_secret' => "", + 'consumer_key' => "", + 'consumer_secret' => "" +); + +/** URL for REST request, see: https://dev.twitter.com/docs/api/1.1/ **/ +$url = 'https://api.twitter.com/1.1/blocks/create.json'; +$requestMethod = 'POST'; + +/** POST fields required by the URL above. See relevant docs as above **/ +$postfields = array( + 'screen_name' => 'usernameToBlock', + 'skip_status' => '1' +); + +/** Perform a POST request and echo the response **/ +$twitter = new TwitterAPIExchange($settings); +echo $twitter->buildOauth($url, $requestMethod) + ->setPostfields($postfields) + ->performRequest(); + +/** Perform a GET request and echo the response **/ +/** Note: Set the GET field BEFORE calling buildOauth(); **/ +$url = 'https://api.twitter.com/1.1/followers/ids.json'; +$getfield = '?screen_name=J7mbo'; +$requestMethod = 'GET'; +$twitter = new TwitterAPIExchange($settings); +echo $twitter->setGetfield($getfield) + ->buildOauth($url, $requestMethod) + ->performRequest();