I recently redirected my website from www.unreadyanwilling.com to cros.land.
While the redirects went well, I wanted to see if there was a way to retain the likes and tweets that each post had earned.
I read that one way to do this is to replace the like button's URL with the old URL. The problem is I have a social plugin which doesn't allow me to change the individual URL of each like button.
I'm seeing if there is an easy snippet of code I can attach to the end of my post to change the iframe URL of the facebook like button from the new URL to the old URL
I'm trying it out on this page: http://cros.land/2013/11/technology-and-meditation/
I'm trying to use document.querySelectorAll() to find the iframe by its src attribute because there is no id or class for this iframe. After getting this element, I'd like to replace it with the old attribute.
So far this code doesn't seem to be working (I put it at the end of my post):
<script type="text/javascript">
var oldInput = document.querySelectorAll("[src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcros.land%2F2013%2F11%2Ftechnology-and-meditation%2F&send=false&layout=box_count&width=50&show_faces=false&action=like&colorscheme=light&font=arial&height=65"]");
oldInput.src = "//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.unreadyandwilling.com%2F2013%2F11%2Ftechnology-and-meditation%2F&send=false&layout=box_count&width=50&show_faces=false&action=like&colorscheme=light&font=arial&height=65";
</script>