Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Kiyoshi Aman
Chessa
Commits
3fd9e6bd
Commit
3fd9e6bd
authored
Feb 22, 2021
by
Kiyoshi Aman
Browse files
Twitter: move reply-ability to tags, clean up reference tags
parent
eb8fe93a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
scripts/Chessa/URI/Plugin/Twitter.pm
scripts/Chessa/URI/Plugin/Twitter.pm
+12
-3
No files found.
scripts/Chessa/URI/Plugin/Twitter.pm
View file @
3fd9e6bd
...
...
@@ -94,12 +94,17 @@ sub get {
$on_info
->
(
$self
->
process_tweet
(
$json
));
}
our
%tags
=
(
quoted
=>
'
quote
',
replied_to
=>
'
reply
',
);
sub
process_tweet
{
my
$self
=
shift
;
my
(
$tweet
)
=
@_
;
# handle (displayname verified?): text Posted: datetime Mode: mode
my
$fmt
=
'
%s (%s): %s %s:
%s %s:
%s
';
my
$fmt
=
'
%s (%s): %s %s: %s
';
my
$text
=
$tweet
->
{
data
}{
text
};
my
$aid
=
$tweet
->
{
data
}{
author_id
};
...
...
@@ -153,9 +158,14 @@ sub process_tweet {
}
if
(
exists
(
$tweet
->
{
data
}{
referenced_tweets
}))
{
for
my
$ref
(
@
{
$tweet
->
{
data
}{
referenced_tweets
}})
{
push
@flags
,
$ref
->
{
type
}
;
push
@flags
,
(
exists
(
$tags
{
$ref
->
{
type
}})
?
$tags
{
$ref
->
{
type
}}
:
$ref
->
{
type
})
;
}
}
if
(
$mode
eq
'
mentionedUsers
')
{
push
@flags
,
'
reply🔒mentions
';
}
elsif
(
$mode
eq
'
following
')
{
push
@flags
,
'
reply🔒followers
';
}
@flags
=
uniqstr
(
@flags
);
if
(
@flags
>
0
)
{
...
...
@@ -167,7 +177,6 @@ sub process_tweet {
$screen
.
(
$vbool
?
"
$green$verify$end
"
:
"
$red$verify$end
"),
$text
,
"
${bold}
Posted
$end
",
$posted
,
"
${bold}
Replies
$end
",
$mode
,
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment