網頁

2009年12月19日 星期六

Facebook auto receive gifts

When your facebook gift is too much, You can use the automatic tool.
Use the Firefox + Selenium Add-on.

Firefox is a browser. such as IE; Opera; Google Chrome.
Selenium is a tool. Is firefox add-on. The tool can auto control a web pages. For web developers is automatic test.

* Install Firefox & Run.
* Install the Selenium Add-On. (Using Firefox open the Selenium page. Click 'Add to Firefox' button)
* Download the file 'AcceptGift.test' used to receive gifts. (Please right-click -> "Save As")
* Click Firefox -> Tools -> Selenium IDE, Then opened the Selenium.

* Click Selenium-> File -> Open, Choose the 'AcceptGift.test'.
* Click the "Green Arrow with Dash" button to run, then begin to accept gift.
* If stop or many gifts is waiting. just click to run again.


ps. You must already agree the game of gift.
ps.2. In AcceptGift.test. Two lines is receive one gift. So you can copy & paste for more gifts.

2009年12月11日 星期五

facebook自動收禮物

facebook收到的禮物太多,收的很累嗎?自動收禮物幫助您。
一個簡單的方法,使用Firefox + Selenium
要開始的可直接看後段步驟。

Selenium是一個用來自動操作網頁的工具,對網頁開發者而言,可以做自動測試。
這不是幫你玩遊戲,不算機器人,只是禮物太多了,而且收禮物常要來來回回按來按去的,有時很慢又要等很久。

當然其實這個Selenium當然不只能收禮物,還能...
幫你收錢,放進銀行,還有幫你按任務等等,不過我沒有放出下載,
每個人玩的遊戲不同嘛,也不知有無違反遊戲的規則。
這也算是推廣Firefox嗎?? cc...

  • 先安裝Firefox

  • 完成後使用Firefox安裝Selenium Add-On。(請按Add to Firefox按鈕)

  • 下載用來接收禮物的檔案AcceptGift.test。(請按右鍵->另存)

  • 按Firefox->工具->Selenium IDE,就打開Selenium了。


  • 按Selenium->檔案->Open,再去選擇下載的AcceptGift.test

  • 再按下"箭頭+一條橫線"的按鈕來執行,就開始收禮物啦。

  • 如果沒收完或停住了,只要再按一次執行就OK了。


ps.必需是已同意的遊戲收禮物才會成功喔,否則該禮物會出現同意畫面,然後就繼續收下一個禮物了。
ps.2.在Selenium中AcceptGift.test的內容,兩行就是收一個禮物,所以也可以多複制幾組,一次就可多收些禮物,當然中間要順利,有時網頁會有狀況發生,造成停止。

2009年12月4日 星期五

html include html,兩種工具介紹與比較。

沒有Server Side的支援,又不想用iframe,想用html include html。
這裡提供兩個選擇,
1.inc-5(jQuery Plugin)inc: A super-tiny client-side include JavaScript jQuery plugin
2.jQuery UI - Tabs

先說明第2個,jQuery UI - Tabs,你可以只做一頁,有頭有尾,包函css等,然後用Tab的方式,當按下Tab時,會去載入該頁內容,而該頁只需是沒頭沒尾、乾淨的、只有內容的html code。
優:網頁內容單獨維護,乾淨簡單。
缺:搜尋引擎找到內頁內容時,你只能讓人看到白白的純HTML。

inc-5,網頁中就有範例。實做上有兩種大方向:
1.同jQuery UI - Tabs,只做一個page,onclick時再動態載入需要的內容。
2.每個page獨立,可以用javascript的方式,動態載入header或footer之類include用的檔案。
個人還沒有實做,但猜想:每個Page可以用最簡單的方式,但或許要包函一點必備的html頭尾及inc-5等,其它的網頁頭尾用inc-5,網頁其它設定及需求,都用js動態載入動態處理,或某些可寫在header.inc中。

2009年11月19日 星期四

使用Ruby修改檔案內容

以下是使用Ruby修改檔案,主要目的是修改sympa(mailing list)中許多目錄(list)中的config檔案內容。
using ruby modify file content.
config的內容中找到"owner_include"區段將"profile normal"替換成"profile privileged"。

<--
Dir.chdir("/usr/local/sympa/expl")
Dir.glob("*-*").each do |x|
if File::directory?(x)
config_file = File.join(x, 'config')
if File.exist?(config_file)
puts config_file
flag = false
File.open(config_file, 'r+') do |f|
out = ""
f.each do |line|
if line =~ /owner_include/
flag = true
elsif line =~ /^$/
flag = false
elsif flag == true
if line =~ /profile normal/
line = "profile privileged\n"
end
end
out << line
end
#write to file
f.pos = 0 #from line 1
f.print out #write
f.truncate(f.pos) #truncate after current position
end
end
end
end
-->

2009年5月8日 星期五

各種版本IE的網頁測試

請出IETester,建立出一個多版本的IE測試環境。
可安裝在Windows 7, Vista and XP,可測試IE8, IE7 IE 6 and IE5.5。
這可比弄好幾套OS簡單的多了。

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8, IE7 IE 6 and IE5.5 on Windows 7, Vista and XP, as well as the installed IE in the same process.

2009年4月8日 星期三

推! MiniJQueryLab

不錯的工具,可以測試jQuery,也可以測JavaScript、HTML和CSS。

2009年3月13日 星期五

[程式]讓你Javascript更小更正確-用JSLint檢查語法,用Packer壓縮

由於javascript是一個結構非常鬆散的物件語言,在寫javascript的時候,常常很容易出現缺失,有時候可能少了一個逗點(,),也有可能少個分號(;),結果卻依然可以執行。

詳全文

2009年3月7日 星期六

HTML原始檔中js及css後面加了"?數字"是什麼用途?

在Ruby on Rails產生的網頁原始碼中總看到assets的後面會多一段數字,像是:
<script src="/javascripts/cache/bundle.js?1236331223" type="text/javascript"></script>
現在才知道這是為了讓確保使用者能夠拿到最新的javascript或css檔案。

看到一個Plugins - Asset timestamping,會把最後修改的timestamp加到URL中,但是plugin的comment中就有人回應「Looks like assets are timestamped in Rails automatically now (v 1.1+)」,可能這是很舊的plugin了吧!

做了測試用Live HTTP Headers去看:
1.先隨便試一個js檔,如:http://wadevelop.blogspot.com/xxx.js?12345
Cotent-Length:9999
2.再開新的tab,一樣連到http://wadevelop.blogspot.com/xxx.js?12345
Cotent-Length:0
3.然後換連到http://wadevelop.blogspot.com/xxx.js?abcde
Cotent-Length:9999
證明了?後面更新timestamp,使用者就不會使用cache,而會重新載入js或css檔案。

2009年3月2日 星期一

完整的iframe auto height程式(在iframe內容頁中處理)

全部參考:
1.Iframe自動調整高度, 在子網域SubDomain的情形
2.處理iframe auto height(Iframe自適應高度)
3.處理iframe auto height(Iframe自適應高度) - 相關問題紀錄
4.完整的iframe auto height程式(在iframe內容頁中處理)
5.或許你想要 "html include html,兩種工具介紹。"


以下是一個完整的iframe auto height程式,放在iframe內容頁的網頁中即可。 看Demo
程式使用了google的AJAX Libraries API來載入jQuery,並使用jQuery來處理部份的程式。
不需要在iframe設定name或id,因為程式會找到自己的iframe。


2009年2月2日 星期一

處理iframe auto height(Iframe自適應高度) - 相關問題紀錄

全部參考:
1.Iframe自動調整高度, 在子網域SubDomain的情形
2.處理iframe auto height(Iframe自適應高度)
3.處理iframe auto height(Iframe自適應高度) - 相關問題紀錄
4.完整的iframe auto height程式(在iframe內容頁中處理)
5.或許你想要 "html include html,兩種工具介紹。"


請注意以下內容都是在iframe onload時處理的。

parent不存在的問題


1.可能是用google找到了iframe的內容,這時沒有parent
2.iframe有時會單獨存在(被單獨開啟)
,這時若去執行iframe_auto_height(),當然會有錯誤發生。
判斷的方法是if(parent != window)時才執行。

parent和iframe是cross site的問題


1.有時可能別人的網站,用iframe嵌入你的iframe內容
寫了以下is_crosssite()來判斷是不是cross site,應和[parent不存在的問題]同時判斷




Iframe自動調整高度, 在子網域SubDomain的情形


請參考在子網域SubDomain的情形

parent不是自己的網站時(或iframe單獨存在時),想要加上logo或header & footer


1.有時可能別人的網站,用iframe嵌入你的iframe內容
2.可能是用google找到了iframe的內容,這時沒有parent
3.iframe有時會單獨存在(被單獨開啟)
以下是使用jQuery將logo附加在頁面的右下角




iframe中的link是完整網頁時(或別人的網站)


1.不是link到iframe的內容,是link到parent的頁面
2.可能是link到別人的網站。
就是已包函外框的網頁,不適合放在iframe中,會破壞畫面,變成一層一層的。
這時最好使link<a>的target是_top或_blank,才不會開在iframe中。
以下是使用jQuery去改變http:開頭的target都變成_top,所以自己的內部連結都不應用完整的網址。