mirror of
https://github.com/Eleirbag89/MastodonBotPHP
synced 2025-03-15 23:50:04 +01:00
Merge pull request #7 from Eleirbag89/analysis-rrv2aG
Apply fixes from StyleCI
This commit is contained in:
commit
314f677464
@ -25,7 +25,7 @@
|
||||
{
|
||||
$headers = [
|
||||
'Authorization: Bearer '.$this->token,
|
||||
'Content-Type: multipart/form-data'
|
||||
'Content-Type: multipart/form-data',
|
||||
];
|
||||
|
||||
$ch = curl_init();
|
||||
|
@ -11,7 +11,7 @@
|
||||
$tagline = ' check out on ';
|
||||
|
||||
if (!($jsonTxt = file_get_contents($feed_url))) {
|
||||
die('Error loading the feed url');
|
||||
exit('Error loading the feed url');
|
||||
}
|
||||
|
||||
$json = json_decode($jsonTxt, true);
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
array_push($statuses, $post);
|
||||
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);
|
||||
fclose($myfile);
|
||||
$first_article = true;
|
||||
|
@ -10,7 +10,7 @@
|
||||
$file = 'data.txt';
|
||||
|
||||
if (!($rss = simplexml_load_file($feed_url))) {
|
||||
die('Error loading the feed url');
|
||||
exit('Error loading the feed url');
|
||||
}
|
||||
|
||||
$first_article = false;
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
array_push($statuses, $post);
|
||||
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);
|
||||
fclose($myfile);
|
||||
$first_article = true;
|
||||
|
@ -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.
|
||||
$statusText = 'This is a status';
|
||||
|
||||
$statusData = array(
|
||||
'status' => $statusText,
|
||||
'privacy' => $privacy,
|
||||
'language' => $language
|
||||
);
|
||||
$statusData = [
|
||||
'status' => $statusText,
|
||||
'privacy' => $privacy,
|
||||
'language' => $language,
|
||||
];
|
||||
|
||||
$mastodon = new MastodonAPI($token, $baseURL);
|
||||
$result = $mastodon->postStatus($statusData);
|
||||
|
||||
// Activate the next line if you want to print the result of the query
|
||||
//var_dump($result);
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user