init III
This commit is contained in:
30
Mastodon/toot3.pl
Normal file
30
Mastodon/toot3.pl
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/perl
|
||||
|
||||
#Client-Schlüssel 8aJzHkVjpomU2UUl_W8G_90Syb3P9Eg5xK61Nwti85o
|
||||
#Client-Secret v6zxkyQ1oNVr4RbB50w9dIancWDKhpXRgxG_4dej0eo
|
||||
#Dein Zugangs-Token KkfiWIzBCAAiVOff9OHK0ka8fCsA-RAP-1TS9a_1Fks
|
||||
|
||||
use Mastodon::Client;
|
||||
|
||||
|
||||
|
||||
my $client = Mastodon::Client->new(
|
||||
instance => 'hessen.social',
|
||||
name => 'perltoot',
|
||||
client_id => '8aJzHkVjpomU2UUl_W8G_90Syb3P9Eg5xK61Nwti85o',
|
||||
client_secret => 'v6zxkyQ1oNVr4RbB50w9dIancWDKhpXRgxG_4dej0eo',
|
||||
access_token => 'KkfiWIzBCAAiVOff9OHK0ka8fCsA-RAP-1TS9a_1Fks',
|
||||
coerce_entities => 1,
|
||||
api_version => 2,
|
||||
);
|
||||
|
||||
my $listener = $client->stream( "#natenom" );
|
||||
# Streaming interface might change!
|
||||
|
||||
$listener->on( update => sub {
|
||||
my ($listener, $status) = @_;
|
||||
printf "%s said: %s\n",
|
||||
$status->account->display_name,
|
||||
$status->content;
|
||||
});
|
||||
$listener->start;
|
||||
Reference in New Issue
Block a user