Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions facebook/facebook.feh
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ namespace Facebook {
curl.setOption(Curl.CURLOPT_RETURNTRANSFER, 1);
curl.setOption(Curl.CURLOPT_TIMEOUT, 60);

if( curl.exec() ) {
string content = curl.getContent();

monitor {
// Uncomment the below to print debug output with the received content.
//Console.println('Content: ' + content);
// data is defined at the top of the run function
data = JSON.parse(content);
} handle {
raise new Error("Error when parsing response: ${content}");
}
} else {
monitor {
if( curl.exec() ) {
string content = curl.getContent();

monitor {
// data is defined at the top of the run function
//Console.println('Content: ' + content);
data = JSON.parse(content);
} handle {
raise new Error("Error when parsing response: ${content}");
}
}
}
handle {
raise new Error("Error when connecting to: ${url}");
}

Expand Down Expand Up @@ -121,19 +123,21 @@ namespace Facebook {
curl.setOption(Curl.CURLOPT_RETURNTRANSFER, 1);
curl.setOption(Curl.CURLOPT_TIMEOUT, 60);

if( curl.exec() ) {
monitor {
if( curl.exec() ) {
string content = curl.getContent();

monitor {
// Uncomment the below to print debug output with the received content.
//Console.println('Content: ' + content);
// data is defined at the top of the run function
//Console.println('Content: ' + content);
data = JSON.parse(content);
} handle {
raise new Error("Error when parsing response: ${content}");
}
} else {
raise new Error("Error when connecting to: ${url}");
}
}
handle {
raise new Error("Error when connecting to: ${url}");
}

return data;
Expand Down