Rename and update to server
[EroTweet.git] / timed-post.php
blob97e03428f25bf11eba76f81ed114baae8c7c8fee
1 <?php //When called, make a request to pull a tweet from an SQL table
2 require_once("class/queue-database-construction.php");
3 $construction = new QueueDatabaseConstruction();
4 //row array
5 $oldest = $construction->retrieveOldestEntry();
6 echo "<br/>" . var_dump($oldest);
7 echo "<hr/>";
9 //ob_start();
10 require_once("class/twitter-connection.php");
11 //ob_end_clean();
12 $connection = new TwitterConnection();
13 $response = $connection->makeTweet($oldest[0]["Comment"], explode(",", $oldest[0]["ImageLocation"]));
14 echo "</pre>";
15 echo $oldest[0]["Comment"] . "<hr/>";
16 if($response["created_at"] === null){
17 echo "post unsuccessful";
18 return;
20 else {
21 $construction->deleteOldestEntry($oldest);
22 echo "Found, Added and Deleted<br/>";