Skip to content

Instantly share code, notes, and snippets.

@takano32
Forked from sorah/muretweet.user.js
Created May 3, 2009 16:01
Show Gist options
  • Save takano32/106032 to your computer and use it in GitHub Desktop.
Save takano32/106032 to your computer and use it in GitHub Desktop.
xpath使わないヤツ
// ==UserScript==
// @name muReTweet
// @namespace muretweet
// @description
// @include http://twitter.com/*/statuses/*
// @include http://twitter.com/*/status/*
// ==/UserScript==
//ReTweet用URLの生成//////////////////
///////postの内容を取得
var tweet = "" + document.getElementsByClassName('entry-content')[0].innerHTML.replace(/<[^>]*>/g, "");
///////IDを取得
var tid = document.getElementsByClassName('screen-name')[0].innerHTML.replace(/<[^>]*>/g, "");
///////URL組み立て
var url = "http://twitter.com/home?status="+encodeURI("RT: "+tweet+"("+location.href+" ) (@"+tid+")");
// console.log(url);
//ReTweetボタン設置//////////////////////
///////RTボタン設置先のobject取得
var actions = document.getElementsByClassName('actions')[0];
///////element作成
var elm = document.createElement('a');
elm.setAttribute("href",url);
elm.setAttribute("class","");
elm.style.backgroundImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAANkDQtZPoQAAAwBQTFRFw8PD///M//+Z//9m//8z//8A/8z//8zM/8yZ/8xm/8wz/8wA/5n//5nM/5mZ/5lm/5kz/5kA/2b//2bM/2aZ/2Zm/2Yz/2YA/zP//zPM/zOZ/zNm/zMz/zMA/wD//wDM/wCZ/wBm/wAz/wAAzP//zP/MzP+ZzP9mzP8zzP8AzMz/zMzMzMyZzMxmzMwzzMwAzJn/zJnMzJmZzJlmzJkzzJkAzGb/zGbMzGaZzGZmzGYzzGYAzDP/zDPMzDOZzDNmzDMzzDMAzAD/zADMzACZzABmzAAzzAAAmf//mf/Mmf+Zmf9mmf8zmf8Amcz/mczMmcyZmcxmmcwzmcwAmZn/mZnMmZmZmZlmmZkzmZkAmWb/mWbMmWaZmWZmmWYzmWYAmTP/mTPMmTOZmTNmmTMzmTMAmQD/mQDMmQCZmQBmmQAzmQAAZv//Zv/MZv+ZZv9mZv8zZv8AZsz/ZszMZsyZZsxmZswzZswAZpn/ZpnMZpmZZplmZpkzZpkAZmb/ZmbMZmaZZmZmZmYzZmYAZjP/ZjPMZjOZZjNmZjMzZjMAZgD/ZgDMZgCZZgBmZgAzZgAAM///M//MM/+ZM/9mM/8zM/8AM8z/M8zMM8yZM8xmM8wzM8wAM5n/M5nMM5mZM5lmM5kzM5kAM2b/M2bMM2aZM2ZmM2YzM2YAMzP/MzPMMzOZMzNmMzMzMzMAMwD/MwDMMwCZMwBmMwAzMwAAAP//AP/MAP+ZAP9mAP8zAP8AAMz/AMzMAMyZAMxmAMwzAMwAAJn/AJnMAJmZAJlmAJkzAJkAAGb/AGbMAGaZAGZmAGYzAGYAADP/ADPMADOZADNmADMzADMAAAD/AADMAACZAABmAAAz7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEQAAAO4AAN0AALsAAKoAAIgAAHcAAFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAiAAAR////3d3du7u7qqqqiIiId3d3VVVVREREIiIiERERAAAAEHN5TQAAAAlwSFlzAAALEwAACxMBAJqcGAAAACJ0RVh0U29mdHdhcmUAUXVpY2tUaW1lIDcuNiAoTWFjIE9TIFgpAD5Cch0AAAAHdElNRQfZBA8IMCnH4a72AAAAPElEQVR4nGP4igYYgAgIwEwwzQCmGaDiQJosga9Qga9wAahlEIugLAYExYDG/8qA4EMlUeXhpqH4hVQBANZWpJ3KWeV4AAAAAElFTkSuQmCC)'
// console.log(elm);
actions.appendChild(elm);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment