I have successfully extracted tweets belonging to a certain hashtag.
For people interested in code,Its at the bottom.
This is what I have done:#Dhoom3teaser
But for some reasons I need to get every single tweet inserted in to my table.How do I keep inserting something at regular interval without repitition.(i.e tweet should be inserted according to their timestamp).How do I distinguish tweets?
I thought may be I will use setInterval.But then Thought there could be a better solution.
Hope I am clear?
<?php
ini_set('display_errors', 1);
require_once('TwitterAPIExchange.php');
include_once $_SERVER["DOCUMENT_ROOT"]."/includes/db/db_conn.php";
$settings = array(
'oauth_access_token' => "",
'oauth_access_token_secret' => "",
'consumer_key' => "",
'consumer_secret' => ""
);
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$getfield = '?q=#Dhoom3Teaser';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
$decoded = json_decode($response);
echo '<pre>';print_r($decoded);echo '<pre>';