hatedara-mode
濶ッ縺?↑繝シ縲√@縺ー繧峨¥縺薙l縺ィhowm繧剃スオ逕ィ縺励h縺?°縺ェ
gist.github.com のコードをはてなダイアリーに貼り付けたい
追記:
gistのスクリプトはそのまま貼れるらしい。
はてなダイアリーで許可されてるのね、まず普通に試せば良かった・・
ということで↓のスクリプトは不要ですーー
===
http://gist.github.com/ 便利、確かにGreasemonkeyのuser.jsを置いておくとかの用途には良いなー
gist.github.com で GreaseMonkey Script を管理しよう
にあるuser.jsを入れると、Gistのサイト上にインストールリンクっぽい何かが付いて、インストールも簡単
誰かがforkして改造したのを、本家にpullでマージするとか。本家がマージしなくてもforkしたらリンクが張られるのでユーザは好きなバージョンを入れれば良いので安心できる。
gistをはてなダイアリーに張る
ちょっとしたメモは、はてなダイアリーで付けていこうと思うので、gistのコード片を貼れると便利
ということで、はてなにgistのコードを貼るためのGoogle gadgets XMLと、gistのサイト上にその貼り付けscriptタグを表示するGreasemonkeyスクリプトを書いてみた.
http://gist.github.com/2649 : gist_link_google_gadgets.user.js
http://gist.github.com/2651 : gist google gadgets.xml
最初の http://gist.github.com/2649 をGreasemonkeyへ入れる
一応貼り付けできたかな
でもGoogle gadgetsで高さの自動調整方法が判らないので微妙、、dynamic-heightモジュールを使うらしいけど駄目だった
誰かforkして直してください:)
あとgist、コードのrawの最新パーマリンクは無いのかな? http://gist.github.com/raw/2649/trunk みたいな
TwitterからWassrへ完全に移行するための10の方法
Wassrが好きで好きでしょうがない・Twitterなんて二度と見たくない! そんなWassr右翼に
/etc/hostsに
127.0.0.1 twitter.com
を追加する。
で
require "socket" proxy = TCPServer.open(80) while true Thread.start(proxy.accept) do |twitter_client| TCPSocket.open("api.wassr.jp", 80) do |wassr| buff = "" while !(twitter_client.gets =~ /^(\n|\r\n)$/) buff << $_ end wassr.write buff.gsub(/Host: twitter.com/, "Host: api.wassr.jp") + "\r\n" twitter_client.write toTwittelike(wassr.read) end twitter_client.close end end
こんな感じで今日からいつものTwitterクライアントで快適Wassr生活(GETだけ)
Twitterrific
Twitter Pod
理想を言えば
WassrとTwitterのAPIが完全互換だったら良かったけど、少し違うので適当に無理矢理矯正した、きっと来週の今頃にはWassrの中の人が頑張って完全互換になってると思うで、その頃には無用になってるんじゃないか
$KCODE = "utf8" require "socket" template1 = <<EOF <source><a href="http://d.hatena.ne.jp/lynmock/20071107/p2">P3:PeraPeraPrv</a></source> <truncated>false</truncated> <in_reply_to_status_id></in_reply_to_status_id> <in_reply_to_user_id></in_reply_to_user_id> <favorited></favorited> EOF template2 = <<EOF <id>12345</id> <name>PROFILE_NAME_SAMPLE</name> <location>Tokyo, JAPAN</location> <description></description> <profile_image_url>PROFILE_URL_SAMPLE</profile_image_url> <url>http://example.com/</url> <protected>false</protected> <followers_count>100</followers_count> EOF @@reg = [[Regexp.new("<link>[^<]*</link>"), "<created_at>Thu Jul 03 16:01:47 +0000 2008</created_at>"], [Regexp.new("epoch>"), "id>"], [Regexp.new("<rid>([^<]*)</rid>"), template1], [Regexp.new("<user>"), "<user>\n"+template2]] def toTwittelike(wass) head, *body = wass.split(/(\n\n|\r\n\r\n)/) temp = [] body.shift body.join("\r\n").split(Regexp.new("</status>","g")).each do |status| @@reg.each do |reg| status.gsub!(reg[0], reg[1]) end if status =~ /<screen_name>([^<]*)<\/screen_name>/ name = $1.to_s status.gsub!(/PROFILE_URL_SAMPLE/, "http://wassr.jp/user/#{name}/profile_img.png.128.1215043742").gsub!(/PROFILE_NAME_SAMPLE/, name) end temp << status end body = temp.join("</status>") head = head.gsub(/Content-Length: .*(\n|\r\n)/, "") return head + "\r\n\r\n" + body + "\r\n\r\n" end proxy = TCPServer.open(80) while true Thread.start(proxy.accept) do |twitter_client| TCPSocket.open("api.wassr.jp", 80) do |wassr| begin buff = "" while !(twitter_client.gets =~ /^(\n|\r\n)$/) buff << $_ end buff = buff.gsub(/Host: twitter.com/, "Host: api.wassr.jp") + "\r\n" wassr.write buff twitter_client.write toTwittelike(wassr.read) rescue => e p e end end twitter_client.close end end
created_atとか超適当、まあとりあえwassr.rbとかで保存して
sudo ruby wassr.rb
一応
ジョークなので、マジで実行しないように。。
Swurl.comはフレンドリストを自動で追加してくれるのは便利だけど一体どこからアカウントリストを引っ張ってきてるのか問題
friendfeed をTumblr風味にした感のサービス http://www.swurl.com/ でアカウント作ってみた。
ふむ、表示の綺麗なfriendfeedまた放置かな、というくらいの感覚でいたらfriendfeedよろしくフレンド登録機能があり、そのフレンドの新着一覧ページが大変なことになってる
http://tkmr.swurl.com/friends
登録した覚えのないアカウントが山のように・・・これは
Twitter等のフレンドを取得 -> そのフレンドのソーシャルグラフを検索 -> 関連する(と思わしき)アカウントを表示
ってことで良いのかな。Google social graph APIあたりを使ってるくさい気がするけど
Finds your friends on other sites and automatically gives you a feed of their activity.
としか書いて無くて謎だ。