Skip to content

Commit

Permalink
Merge branch 'aaronQueryGoogle'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Crawford committed May 28, 2014
2 parents 4db04c9 + 9caea4d commit 064577e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
6 changes: 4 additions & 2 deletions src/app/mainFeed/BlastView.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ define(['dojo/_base/declare',
}
}

if(this.blastObj.url == "" || this.blastObj.finalUrl != ""){
/*if(this.blastObj.finalUrl != ""){
this.blastObj.imgName = "";
}
}*/

console.log("tokenArr is: ", tokenArr);

console.log("this.blastObj is: ", this.blastObj);

this.sendPostFile(this.blastObj.imgName, tokenArr, msg).then(lang.hitch(this, function(obj){
console.log("obj is: ", obj);
Expand Down
40 changes: 26 additions & 14 deletions src/rest/v1.0/lib/Blast.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ function blastFiles(){

$res = json_decode($response, true);

if(isset($res['error'])){
$returnArray['Facebook'][$x] = array("failure" => 'true', "msg" => "Your Facebook status could not be posted - " . $res['error']['message']);
if(isset($res)){
if(isset($res['error'])){
$returnArray['Facebook'][$x] = array("failure" => 'true', "msg" => "Your Facebook status could not be posted - " . $res['error']['message']);
}else{
$returnArray['Facebook'][$x] = array("success" => 'true', "msg" => "Your Facebook status was posted successfully");
}
}else{
$returnArray['Facebook'][$x] = array("success" => 'true', "msg" => "Your Facebook status was posted successfully");
$returnArray['Facebook'][$x] = array("failure" => 'true', "msg" => "Your Facebook status could not be posted - no response from Facebook");
}
}

Expand Down Expand Up @@ -218,10 +222,14 @@ function blastFiles(){

//print_r($status);

if(isset($status->errors[0]->message)){
$returnArray['Twitter'][$x] = array("failure" => "true", "msg" => "Your Twitter status could not be posted - " . $status->errors[0]->message);
if(isset($status)){
if(isset($status->errors[0]->message)){
$returnArray['Twitter'][$x] = array("failure" => "true", "msg" => "Your Twitter status could not be posted - " . $status->errors[0]->message);
}else{
$returnArray['Twitter'][$x] = array("success" => "true", "msg" => "Your Twitter status was posted successfully");
}
}else{
$returnArray['Twitter'][$x] = array("success" => "true", "msg" => "Your Twitter status was posted successfully");
$returnArray['Twitter'][$x] = array("failure" => "true", "msg" => "Your Twitter status could not be posted - no response from Twitter ");
}
}

Expand Down Expand Up @@ -255,7 +263,7 @@ function blastFiles(){
$imageURL = $_SERVER['HTTP_REFERER'] . 'app/post/tmpUpload/' . $fileName;
$title = "Title";
$shareXML = "<share>
<comment>Test Comment Linkedin</comment>
<comment></comment>
<content>
<title>".$msg."</title>
<submitted-url>".$imageURL."</submitted-url>
Expand Down Expand Up @@ -297,14 +305,18 @@ function blastFiles(){
if($code == "201"){
$returnArray['Linkedin'][$x] = array("success" => "true", "msg" => "Your LinkedIn status was posted successfully");
}else{
$xml = (array)($xml);
if(isset($xml['error-code'])){
$linkCode = $xml['error-code'];
if($linkCode == "0"){
$returnArray['Linkedin'][$x] = array("failure" => "true", "msg" => "Your LinkedIn update could not be posted - Status is a duplicate.");
}else{
$returnArray['Linkedin'][$x] = array("failure" => "true", "msg" => "Your LinkedIn update could not be posted - " . $xml['message']);
if(isset($xml)){
$xml = (array)($xml);
if(isset($xml['error-code'])){
$linkCode = $xml['error-code'];
if($linkCode == "0"){
$returnArray['Linkedin'][$x] = array("failure" => "true", "msg" => "Your LinkedIn update could not be posted - Status is a duplicate.");
}else{
$returnArray['Linkedin'][$x] = array("failure" => "true", "msg" => "Your LinkedIn update could not be posted - " . $xml['message']);
}
}
}else{
$returnArray['Linkedin'][$x] = array("failure" => "true", "msg" => "Your LinkedIn update could not be posted - no response from LinkedIn.");
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions src/rest/v1.0/lib/PublicQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,16 @@ public function writeQueryTerm(){
}

public function getPublicQueryObject(){
$file = "../../publicQueryTermObj.json";
$var = file_get_contents($file);
$fileName = "../../publicQueryTermObj.json";

try{
$feedList = file_get_contents($fileName);
}catch (Exception $e){
$feedList = json_encode(array());
file_put_contents($fileName, $feedList);
}

return $var;
return $feedList;
}

public function deletePublicQueryObjectTerm(){
Expand Down
2 changes: 1 addition & 1 deletion src/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if [ "$CRONGREP" = "" ]; then
echo "no socialreader crons were found... adding cronjobs"

(crontab -l 2>/dev/null; echo "*/5 * * * * sh "$MAINPATH"/cron/callCronManager.sh") | crontab -
#(crontab -l 2>/dev/null; echo "*/10 * * * * sh "$MAINPATH"/cron/callPublicQueryManager.sh") | crontab -
(crontab -l 2>/dev/null; echo "*/10 * * * * sh "$MAINPATH"/cron/callPublicQueryManager.sh") | crontab -
(crontab -l 2>/dev/null; echo "* */23 * * * sh "$MAINPATH"/cron/callClientManager.sh") | crontab -
(crontab -l 2>/dev/null; echo "*/20 * * * * sh "$MAINPATH"/cron/poller/clearLogPoller.sh") | crontab -
(crontab -l 2>/dev/null; echo "*/3 * * * * sh "$MAINPATH"/cron/esHeartbeat.sh") | crontab -
Expand Down

0 comments on commit 064577e

Please sign in to comment.