Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Today, I take a cursory glance at a new service:
- .--. . .---. .
- : _|_ | _|_
- | .--.. ..,-. | .-. |. . ._.-. .-. |
- : | | || )| ( )| \ \ / (.-'(.-' |
- `--'' `--||`-' `-'`-' ' `' `' `--'`--'`-'
- ;|
- `-' '
- This Source Code: https://www.cryptotweet.com/js/script.js */
- Special thanks to:
- http://jsbeautifier.org/
- http://www.network-science.de/ascii/
- */
- var project_url = '';
- var timer;
- /* SNIP */
- $(function () {
- if ($("textarea#tweet").attr("id") !== undefined) {
- $("textarea#tweet").focusin(function () {
- $("textarea#tweet").css("height", "85px")
- });
- $("textarea#tweet").focusout(function () {
- $("textarea#tweet").css("height", "25px")
- })
- }
- if ($("select#recipient").attr("id") !== undefined) {
- $("select#recipient").next("a").click(function (e) {
- e.preventDefault();
- $(this).html('Loading..');
- $.get(project_url + "/twitter/update_followers/", function () {
- window.location.href = '/projects/CryptoTwitter/'
- });
- return false
- });
- load_friends();
- $("select#recipient").click(function () {
- load_friends()
- })
- }
- if ($("textarea#tweet").attr("id") !== undefined) {
- $("textarea#tweet").keyup(function () {
- if ((130 - $(this).val().length) >= 0) {
- $("span#charcount").html(130 - $(this).val().length)
- } else {
- $("textarea#tweet").val($("textarea#tweet").val().slice(0, 130))
- }
- });
- // ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
- // HERE IS THE IMPORTANT PART:
- $("button#send_tweet").click(function () {
- $(this).html("Sending..").attr('enabled', false).attr('disabled', true).attr('readonly', true).delay(100);
- if ($("textarea#tweet").val().length > 0 && $("input[name='csrf_crypto']").val() !== "" && $("select#recipient").val() >= 0) {
- $.post(project_url + "/twitter/send_tweet/", {
- tweet: $("textarea#tweet").val(),
- csrf_crypto: $("input[name='csrf_crypto']").val(),
- recipient: $("select#recipient").val(),
- tweet_also: ($("input#tweet_also:checked").val() !== undefined ? 1 : 0)
- }, function (result) {
- if (parseInt(result) === 1) {
- $("textarea#tweet").val("")
- } else {
- $("textarea#tweet").val("Tweet could not be send. Try again later.")
- }
- $("span#charcount").keyup();
- $("button#send_tweet").html("ETweet!").attr('enabled', true).attr('disabled', false).attr('readonly', false).delay(100);
- return false
- })
- }
- })
- // LOOK, IT JUST SENDS TO THE SERVER TO DO THE CRYPTO!!!
- // ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
- }
- /* SNIP */
- });
- /*
- From the FAQ page on CryptoTweet:
- Q: Can you read my ETweets?
- A: No, even we can't read your ETweets because they are not designated to us and therefor we can't read/decrypt them.
- # ORLY? What if you did that this?
- root@cryptotweet:/# nc -vl 443
- Try it, you should get raw post data with plaintext as soon as someone tries to post an ETweet.
- There are probably more things that need to be addressed, but this was one source of concern I found. Generally, you should only use Twitter for public conversations anyway; there are other venues for private discussion (e.g. XMPP+TOR+OTR in Virtualbox+LUKS)
- */
Advertisement
Add Comment
Please, Sign In to add comment