3 namespace Drupal\media_entity_twitter;
6 * Defines a wrapper around the Twitter API.
8 interface TweetFetcherInterface {
11 * Retrieves a tweet by its ID.
17 * The tweet information.
19 * @throws \Drupal\media_entity_twitter\Exception\TwitterApiException
20 * If the Twitter API returns errors in the response.
22 public function fetchTweet($id);
25 * Returns the current Twitter API credentials.
28 * The API credentials. Will be an array with consumer_key, consumer_secret,
29 * oauth_access_token, and oauth_access_token_secret elements.
31 public function getCredentials();
34 * Sets the credentials for accessing Twitter's API.
36 * @param string $consumer_key
38 * @param string $consumer_secret
39 * The consumer secret.
40 * @param string $oauth_access_token
41 * The OAuth access token.
42 * @param string $oauth_access_token_secret
43 * The OAuth access token secret.
45 public function setCredentials($consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret);