Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name='description' content='{MetaDescription}'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
# 1. Make sure you have nginx sub module compiled in
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module'
# 2. add two directives below at HTTP level
# nginx.conf
http {
# ......
sub_filter '</head>' '<style type="text/css">html{ filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */

Adding Open Graph metadata to Blogger is easy. Simply copy the code below and paste it into your template after the <header> tag.

A couple notes:

  • og:locale Should probably actually reflect the blog's locale instead of just being a hardcoded string. Unfortunately, Blogger only gives us en-us with a hyphen, instead of an underscore, so that won't work.
  • If you're using your blog as a personal profile, you may consider changing the second og:type from website to profile and adding your personal information
  • og:image Is only supplied if Blogger finds an image in the current post. However, not supplying og:image is invalid. You could provide an alternate image of your blog logo, or a Gravatar.
  • If you do something cool with this, I'd love to hear about it. [email protected]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta Tags -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="http://sla.ckcdn.com/css/ckLottery.css?20121227"/>
<title>卡提諾公平隨機抽獎器</title>
<!-- END head -->
</head>
<html>
<head>
<style type="text/css">
.help {}
#result { font-weight:bold; font-size: 24px;background-color:yellow;}
a:visited { color:blue; }
.main { font-size:22px; }
#title, #total,#str,#num { width:400px; height:2em;}
.help { cursor:pointer; }
#input-str { position:relative; }
<!-- https://apps.facebook.com/422278034458715/ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
if(top.location == location) top.location.href = 'https://apps.facebook.com/422278034458715/';
//-->
$The Potential of Siri (介紹 siri 的潛力)
http://paulsolt.com/2011/10/the-potential-of-siri/
$How Applidium reverse engineered Siri's protocol
http://arstechnica.com/apple/news/2011/11/a-look-at-how-applidium-reverse-engineered-siris-protocol.ars
法國手機開發商 applidium 用逆向工程透過 iPhone 4s 與 Siri server (guzzoni.apple.com / http://i.imgur.com/tAWuL.png) 溝通,已經確定可以做 speech-to-text 的轉換,他們發現比較耗費資源像是 Siri's speech recognition 是在 server 端完成的,所以理論上是有可能在不支援 siri app 的機器上去做語音辨識的動作,當使用者在 4s 上對 siri 說話,iphone 會把聲音紀錄壓縮成 speex codec (an open audio format that is optimal for voice http://www.speex.org/) 然後透過 HTTP request 傳送到 Apple 的 server,server 則傳回壓縮過帶有回應資訊的 zlib-compressed binary plist
Applidium 團隊接著設置了一個封閉的網路環境用來測試從手機出去的資料,他們設置了一個假的 DNS server 佯裝成 apple 的 siri server,而因為模擬的 siri request 會經過 SSL-encrypted,所以他們得載入特製的 SSL root certificate 到他們的測試 iphone 上才有辦法對假的伺服器做 request,另外也必須在他們的伺服器上放一支 HTTP proxy 來當輸入和輸出資料到 apple server 的中介..