$publishdate = date("Y-m-d H:i:s", strtotime($item['date'])); $sql = "INSERT INTO `wp_blog_feed_comment` (`title`,`description`,`publishdate`,`wp_blog_url_id`,`inserttime`) \n VALUES ('" . remove_spacial_1(remove_spacial(clean_insert($item['title']))) . "','" . remove_spacial_1(remove_spacial(clean_insert($item['content']))) . "','" . $publishdate . "','" . $id . "','" . $date . "');"; mysql_query($sql); } } } else { if (!empty($feed)) { foreach ($feed as $item) { $publishdate = date("Y-m-d H:i:s", strtotime($item['date'])); $sql = "INSERT INTO `wp_blog_feed` (`title`,`description`,`publishdate`,`wp_blog_url_id`,`inserttime`) \n VALUES ('" . remove_spacial_1(remove_spacial(clean_insert($item['title']))) . "','" . remove_spacial_1(remove_spacial(clean_insert($item['description']))) . "','" . $publishdate . "','" . $id . "','" . $date . "');"; mysql_query($sql); } $feedComment = $Rss->getFeed('http://' . $host . '/comments/feed/', Rss::TXT); foreach ($feedComment as $item) { $publishdate = date("Y-m-d H:i:s", strtotime($item['date'])); $sql = "INSERT INTO `wp_blog_feed_comment` (`title`,`description`,`publishdate`,`wp_blog_url_id`,`inserttime`) \n VALUES ('" . remove_spacial_1(remove_spacial(clean_insert($item['title']))) . "','" . remove_spacial_1(remove_spacial(clean_insert($item['content']))) . "','" . $publishdate . "','" . $id . "','" . $date . "');"; mysql_query($sql); } } } } else { //error entry code here $sql25 = "INSERT INTO `tbl_error_log` (reason,message,type,keywordid) \n values ('','Url Not valid','wordpress','" . $id . "')"; mysql_query($sql25) or die(mysql_error()); } } } } } echo "<BR><B>WORDPRESS CRON ENDED @</B> : " . date('Y-m-d H:i:s A') . "<br><br>"; }
} } } //$sql23insta1 = "insert into tbl_twitter_data(keywordId,screenName,name,tweet,tweetDate) values" . implode(',', $insArrTw); //mysql_query($sql23insta1) or die(mysql_error() . "==========>sql23insta1"); } else { $searchResponse = $connection->oAuthRequest($searchUrl, "GET", array('q' => $searchkw, 'count' => TWITTER_COUNT_SIZE)); $searchResponse = json_decode($searchResponse); foreach ($searchResponse as $searches) { foreach ($searches as $search) { if (is_object($search)) { $name = $search->user->name; $screenName = $search->user->screen_name; $tweet = $search->text; $tweetDate = date('Y-m-d H:i:s', strtotime($search->created_at)); $insArrTw[] = "(\t\t\t\t\t\t\t'" . $idinstw1 . "',\n '" . $screenName . "',\n '" . remove_spacial_1(remove_spacial(clean_insert($name))) . "',\n '" . remove_spacial_1(remove_spacial(clean_insert($tweet))) . "',\n '" . $tweetDate . "')"; } } } } } $sql23insta11 = "insert into tbl_twitter_data(project_id,screenName,name,tweet,tweetDate) values" . implode(',', $insArrTw); mysql_query($sql23insta11) or die(mysql_error() . "==========>sql23insta11"); echo "<BR><B>TWITTER CRON ENDED @</B> : " . date('Y-m-d H:i:s A') . "<br><br>"; } if (FACEBOOKCRONSTART == '1') { $sql = "SELECT user_access_token FROM tbl_facebook_user_info LIMIT 1"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_row($result); $user_access_token = $row[0]; if (!empty($user_access_token)) {