New API v1.1 php code not working for my WordPress site (SSL enabled)


#1

Hi,

My WordPress site is SSL enabled. For testing purpose I have created a test page in root directory and used following code in that page:

<?php require "tmhOAuth/tmhOAuth.php"; require "tmhOAuth/tmhUtilities.php"; $consumerKey = "my_consumer_key"; $consumerSecret = "my_consumer_secret"; $userToken = "my_user_token"; $userSecret = "my_user_secret"; $screeName = "my_username"; $noOfTweets = 6; $tmhOAuth = new tmhOAuth(array( 'consumer_key' => $consumerKey, 'consumer_secret' => $consumerSecret, 'user_token' => $userToken, 'user_secret' => $userSecret, )); $code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/statuses/user_timeline'), array( 'screen_name' => $screeName, 'count' => $noOfTweets)); $response = $tmhOAuth->response; echo $response; ?>

I have not excluded any file from “tmhOAuth-master” folder, I have taken from github, just renamed it to “tmhOAuth” from “tmhOAuth-master”. When I run the test page, the page is showing - “Problem loading page, The connection was reset”. Here is the screenshot of the issue page - http://i40.tinypic.com/aewart.jpg.

Can anyone help please how to overcome this issue?

Thanks


#2

Found a solution using different code provided in twitter site. Thanks.


#3

If you can add the link to your solution, this will help someone in the future with a similar problem.


#4

Steps:

  1. Download the zip folder from https://github.com/abraham/twitteroauth as said in https://dev.twitter.com/docs/auth/oauth/single-user-with-examples
  2. Follow the steps given in http://www.webdevdoor.com/javascript-ajax/custom-twitter-feed-integration-jquery/