The built-in social media functions are limited, so I'm using Twitter's web API for my work.
The following function worked for me when I was using versions of Mathematica earlier than 10.3.
token=HTTPClient`OAuthToken[HTTPClient`OAuth`Private`OAuth10Parameters[
"api.twitter.com", None, Automatic, "verifier", Automatic, Automatic,
consumerKey, consumerSecret,
"https://api.twitter.com/oauth/request_token",
"GET", "https://www.twitter.com/oauth/authorize",
"RemoveWhitespace", "https://api.twitter.com/oauth/access_token",
"GET", "HMAC-Sha1", "HMAC", "oob", "Text/1.0", "Text/1.0", None],
HTTPClient`OAuth`Private`Token10[ accessToken, accessTokenSecret]];
url = "https://api.twitter.com/1.1/search/tweets.json";
URLFetch[url, "OAuthAuthentication" -> token]
But when I upgraded to Mathematica 11, that code stopped working and gave error messages like the following:
OAuthSigning`OAuthSignURL::nopt: The option OAuthAuthentication is missing in OAuthSigning`Private`OAuthURLFetchList[https://api.twitter.com/1.1/search/tweets.json?count=100&q=%23brexit, {CredentialsProvider -> None, OAuthAuthentication -> OAuthSigning`OAuthAuthentication[HTTPClient`OAuthToken[HTTPClient`OAuth`Private`OAuth10Parameters[api.twitter.com, None, Automatic, <<15>>, Text/1.0, None], <<1>>]]}].
I also tried the following:
token = HTTPClient`OAuthAuthentication[
"ConsumerKey" -> "your_api_key",
"ConsumerSecret" -> "your_api_secret",
"RequestEndpoint" -> "https://api.twitter.com/oauth/request_token",
"AuthorizeEndpoint" -> "https://api.twitter.com/oauth/authorize",
"AccessEndpoint" -> "https://api.twitter.com/oauth/access_token"];
url = "https://api.twitter.com/1.1/search/tweets.json";
URLFetch[url, "OAuthAuthentication" -> token]
I need my program to be up to date with the latest versions of Mathematica. Any idea where might the problem be?
ServiceConnect
? $\endgroup$tokenFrank = HTTPClient`OAuthAuthentication[ "ConsumerKey" ->"XXX", "ConsumerSecret" ->"XXX", "RequestEndpoint" -> "https://api.twitter.com/oauth/request_token", "AuthorizeEndpoint" -> "link to authorize", "AccessEndpoint" -> "link to access_token"];
Any suggestions? $\endgroup$