I wrote a Steemit tool: "Show Steemit Edits" to see the edit history of any comment or post, with sourcesteemCreated with Sketch.

in #life7 years ago

Here's the tool, at my site. Usage is fairly simple: just copy the URL of any comment or post, paste it into the "Steemit URL" field, and hit Enter or click Go, and it'll show you via steemdb.com the edit history.

http://libertyteeth.xyz/show-steemit-edits/

 

This tool was inspired by @goldkey, who gave me an example from which I determined that it was a simple text transform, so wrapped a regex with a little PHP and a WordPress page, and now it's simple to see edits. Here's the beginning of that discussion -- the reason I had wanted to see edits in the first place was because of my first stalker, who downvoted 138 of my comments.

Now I have a second stalker, who has decided "I will downvote any post containing 'X'!" I don't care what 'X' is, if you are using regular expressions for evil (i.e., searching for "EOS" and downvoting any post which mentions it which earns more than $0.01), then you are not doing life right.

Anyway, this post is meant to be inspirational: to show that some good can come from evil's actions. I'm not sure what good will come from the current stalker's actions, but something will. Enjoy!

 

Page sources

NOTE: I do not know how best to put code into a Steemit post! The below uses too much whitespace, i.e. it's too "tall". I did it with the backtick characters at the beginning and end of each line of code, and then for lines that don't have a blank line after them, I had to add <br> to the end of each line so it wouldn't bring the next line up. But I'm sure there's an easy way to show code, I just haven't found it yet.

The WordPress page contains this code:

Enter the Steemit URL below, click "Go" and a new tab will open to the steemdb.com site, showing the edits for that comment. NOTE: doesn't open in a new tab just yet!

<form action="../process.php" method="post" name="myForm">

Steemit URL <input id="url" type="text" name="url" />

<input type="submit" value="Go" /></form>

<script type="text/javascript">

/* JS validation code here */

function validateForm()

{

/* Validating url field */

var x=document.forms["myForm"]["url"].value;

/* Simple validation, as an error will appear on steemdb.com if it's incorrect */

var pos=x.indexOf("steemit.com");

if (pos<0)

{

alert("No 'steemit.com' found in URL!");

return false;

}

}

</script>

The "../process.php" file contains this code:

<?php

// Get the form element

$url=$_POST["url"];

// Replace "steemit.com" with "steemdb.com", only the first instance

$pattern = '/steemit\.com/';

$replacement = 'steemdb.com';

$url = preg_replace($pattern, $replacement, $url);

// After the tag, delete everything up to and including the "#"

$pattern = '/^([^\/]+\/\/[^\/]+\/[^\/]+\/)([^\/]+\/)([^\/]+#)(.*)$/';

$replacement = '$1$4';

$url = preg_replace($pattern, $replacement, $url);

// Add "/edits" to the end

$url .= '/edits';

// Redirect to the page

header("Location: $url");

?>

The only issue with the tool at the moment is that it does not open in a new tab, which I would like it to do. I haven't looked into it; I'm sure it's something simple.

Enjoy!



Sort:  

Hello. Thanks for the tool. I think its not possible like that to open in new tab. This is a server side redirect with php. You'll have to do this client side e.g. with javascript.
J

Right, that's what my initial investigation found, and I didn't look any further as to how to do it via Javascript. Do you know how? Thanks!

I dont know exactly what the current way is to do this. There's lots of ways. But many wont work reliable and get blocked by browser intern popup blocker. If I have time in the evening I'll give it a try.
J

Cool, thank you!

Loading...

Hey Libertyteeth :-) I don't understand one single line of this code, but I like the idea and admire such coding work! So good job and worth the upvote! Nice greetings, Martin


Daniel Larimer - Co-Founder of Steemit, bitshares and EOS - my tribute
Do you want to see the full image? Click it!
I am highly grateful for every appreciation of my work!

@dan

Hey thanks! Nice tribute as well! (The trouble with tributes is... -- my wife @countrylover is a Trekkie. :) )

I don't get it :-D

No worries, sometimes I communicate cryptically. :)

There was a Star Trek (the original series) episode titled "The Trouble with Tribbles"; a tribble was a little fur ball, which reproduced like mad (i.e., rabbits; also seems Gremlins might have been based on them as well). They got on board the Enterprise and, well, caused trouble. :)

Thus, I was doing some wordplay on "tribute" and "tribble", and failed since you hadn't been exposed to it. :)

Loading...

You are very clever for an artist! : )

Haha, thanks! My career was software development; I'm only an artist for the past two and a half weeks, after my friend demoed Flame Painter for me. I "can't write software any more" due to the concussions; fortunately this one was a bite-sized piece.

Perhaps I can do more bite-sized pieces, to keep my skills fresh, and keep me motivated. Just, finding them is the tricky part; if it's any more than "bite-sized" then I'll experience frustration trying to work with it, as I forget stuff from one part to the next...

Its a shame that it affects your ability to function at full capacity. You are still quite brilliant in spurts.

Sounds useful if you want to backtrack someone's steps.

1 great idea

@libertyteeth Thanks for your work sir.... Love it.

Great idea ..
Thanks for sharing such great post with us!

Thanks for the information sir.

Wow best tool to unleash the potential of all steemit users. Is it useful for youtube and facebook too?

Nope, neither of those are in the Steemit blockchain.

I suppose, though, that could be fixed? :)

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.032
BTC 60205.00
ETH 2994.41
USDT 1.00
SBD 3.90