Last active
March 13, 2018 12:02
-
-
Save OskarKlintrot/4684c640abcfa497f85dc7e6655c541c to your computer and use it in GitHub Desktop.
Twitter extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://api.twitter.com/1.1/users/report_spam.json?screen_name=rabish2&perform_block=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var template = username => `<span> | |
<button type="button" class=" | |
EdgeButton | |
EdgeButton--danger | |
EdgeButton--small | |
button-text | |
follow-text" onclick="jQuery.post('https://api.twitter.com/1.1/users/report_spam.json?screen_name=${username}&perform_block=true')"> | |
<span aria-hidden="true">Spam</span> | |
<span class="u-hiddenVisually">Report <span class="username u-dir u-textTruncate" dir="ltr">@<b>${username}</b></span></span> | |
</button> | |
</span>` | |
$('.GridTimeline-items') | |
.find('.user-actions') | |
.each(function(index, element) { | |
$(template($(element).data('screen-name'))).insertAfter($(element).find('.user-actions-follow-button')) | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span> | |
<button type="button" class=" | |
EdgeButton | |
EdgeButton--danger | |
EdgeButton--small | |
button-text | |
follow-text" onclick="jQuery.post('https://api.twitter.com/1.1/users/report_spam.json?screen_name=rabish2&perform_block=true')"> | |
<span aria-hidden="true">Spam</span> | |
<span class="u-hiddenVisually">Report <span class="username u-dir u-textTruncate" dir="ltr">@<b>rabish2</b></span></span> | |
</button> | |
</span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment