Merge pull request #7 from Eleirbag89/analysis-rrv2aG

Apply fixes from StyleCI
This commit is contained in:
Grimstack 2022-12-17 18:51:33 +01:00 committed by GitHub
commit 314f677464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View File

@ -25,7 +25,7 @@
{ {
$headers = [ $headers = [
'Authorization: Bearer '.$this->token, 'Authorization: Bearer '.$this->token,
'Content-Type: multipart/form-data' 'Content-Type: multipart/form-data',
]; ];
$ch = curl_init(); $ch = curl_init();

View File

@ -11,7 +11,7 @@
$tagline = ' check out on '; $tagline = ' check out on ';
if (!($jsonTxt = file_get_contents($feed_url))) { if (!($jsonTxt = file_get_contents($feed_url))) {
die('Error loading the feed url'); exit('Error loading the feed url');
} }
$json = json_decode($jsonTxt, true); $json = json_decode($jsonTxt, true);
@ -38,7 +38,7 @@
array_push($statuses, $post); array_push($statuses, $post);
if (!$first_article) { if (!$first_article) {
$myfile = fopen($file, 'w') or die('Unable to open file!'); $myfile = fopen($file, 'w') or exit('Unable to open file!');
fwrite($myfile, $ts); fwrite($myfile, $ts);
fclose($myfile); fclose($myfile);
$first_article = true; $first_article = true;

View File

@ -10,7 +10,7 @@
$file = 'data.txt'; $file = 'data.txt';
if (!($rss = simplexml_load_file($feed_url))) { if (!($rss = simplexml_load_file($feed_url))) {
die('Error loading the feed url'); exit('Error loading the feed url');
} }
$first_article = false; $first_article = false;
@ -35,7 +35,7 @@
array_push($statuses, $post); array_push($statuses, $post);
if (!$first_article) { if (!$first_article) {
$myfile = fopen($file, 'w') or die('Unable to open file!'); $myfile = fopen($file, 'w') or exit('Unable to open file!');
fwrite($myfile, $ts); fwrite($myfile, $ts);
fclose($myfile); fclose($myfile);
$first_article = true; $first_article = true;

View File

@ -8,15 +8,14 @@ $privacy = 'private'; // "Direct" means sending message as a private message. Th
$language = 'en'; // en for English, zh for Chinese, de for German etc. $language = 'en'; // en for English, zh for Chinese, de for German etc.
$statusText = 'This is a status'; $statusText = 'This is a status';
$statusData = array( $statusData = [
'status' => $statusText, 'status' => $statusText,
'privacy' => $privacy, 'privacy' => $privacy,
'language' => $language 'language' => $language,
); ];
$mastodon = new MastodonAPI($token, $baseURL); $mastodon = new MastodonAPI($token, $baseURL);
$result = $mastodon->postStatus($statusData); $result = $mastodon->postStatus($statusData);
// Activate the next line if you want to print the result of the query // Activate the next line if you want to print the result of the query
//var_dump($result); //var_dump($result);
?>