<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EragonJ - A humble navigator &#187; PHP</title>
	<atom:link href="http://eragonj.hax4.in/blog/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://eragonj.hax4.in/blog</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 12:33:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[PHP] PlurkRssParser for plurk users</title>
		<link>http://eragonj.hax4.in/blog/php-rssparser-for-plurk-users.html</link>
		<comments>http://eragonj.hax4.in/blog/php-rssparser-for-plurk-users.html#comments</comments>
		<pubDate>Sun, 14 Nov 2010 16:22:47 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Hax4]]></category>
		<category><![CDATA[member]]></category>
		<category><![CDATA[plurk]]></category>
		<category><![CDATA[RssParser]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[玩具]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=663</guid>
		<description><![CDATA[Tweet 其實是自己太無聊想要為Hax4.in做一些小玩具，目前是Copy Plurk Widget的樣式來做出的頁面，而實際的展示可以在網誌旁邊的Widget列看到。其功能就是能夠整合多人的Plurk資訊並依時間先後排列，目前是整合了我們Hax4.in所有成員的資料。 附上在Github上的原始碼。 順便打個廣告吧，其實我們Hax4.in的網頁很早就寫好了，不過只是個雛型放出來而已，到時候會把我們寫過的一些玩具、視覺設計、案件資訊放出來，希望大家會喜歡:P δ 2010/11/21 加入 feed.cache mechanism 並改變專案名稱為 PlurkRssParser]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphp-rssparser-for-plurk-users.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/php-rssparser-for-plurk-users.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/php-rssparser-for-plurk-users.html"  data-text="[PHP] PlurkRssParser for plurk users" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/11/hax4.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/11/hax4-300x176.png" alt="" title="hax4" width="300" height="176" class="aligncenter size-medium wp-image-664" /></a></p>
<p>
其實是自己太無聊想要為<a href="http://hax4.in">Hax4.in</a>做一些小玩具，目前是Copy Plurk Widget的樣式來做出的頁面，而實際的展示可以在網誌旁邊的Widget列看到。其功能就是能夠整合多人的Plurk資訊並依時間先後排列，目前是整合了我們Hax4.in所有成員的資料。
</p>
<p>
附上在<a href="https://github.com/EragonJ/PlurkRssParser">Github</a>上的原始碼。
</p>
<p>
順便打個廣告吧，其實我們<a href="http://hax4.in">Hax4.in</a>的網頁很早就寫好了，不過只是個雛型放出來而已，到時候會把我們寫過的一些玩具、視覺設計、案件資訊放出來，希望大家會喜歡:P
</p>
<p>
δ 2010/11/21 加入 feed.cache mechanism 並改變專案名稱為 PlurkRssParser</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/php-rssparser-for-plurk-users.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Shark 改版</title>
		<link>http://eragonj.hax4.in/blog/php-shark-%e6%94%b9%e7%89%88.html</link>
		<comments>http://eragonj.hax4.in/blog/php-shark-%e6%94%b9%e7%89%88.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:24:22 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[plurk]]></category>
		<category><![CDATA[Shark]]></category>
		<category><![CDATA[客製化]]></category>
		<category><![CDATA[小籤籤]]></category>
		<category><![CDATA[改版]]></category>
		<category><![CDATA[規則]]></category>
		<category><![CDATA[食我]]></category>
		<category><![CDATA[食我機器人]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=337</guid>
		<description><![CDATA[Tweet 目前shark計畫正在做大規模的改版(加入了sharkCore Class及模組抽換)，不過因為機器人的需求各式各樣，所以想要利用大家的能力來收集一些已經寫好的規則並整合至shark內。以我自己為例，我目前做了「對特定關鍵字的噗做一次性回覆」這個規則(可能的應用如「小籤籤的抽籤功能」、「占卜功能」、「食我機器人」…等)，允許使用者自行定義關鍵字、Qualifier、還有回應、以及回應用的Qualifier，另外在03/06的時候我又做好了一個「在特定時間發噗」的規則(相關的應用如「定時亂喇賽來維持karma」、「定時發自訂的消息」…等)，可以一次定義多時段的發噗內容，例如說我可以在每天十二點問大家吃飯沒，同時每一小時會發出天氣預報。 同時也實作了三種方法來抓取「回應」的內容，你可以把回應的內容放在網路上以檔案的形式呈現，或是你也可以為你的網站設立一個API的接口，透過HTTP的方式去讀你網站的資料(例如你的網站是有關於美食的，你就可以提供一個接口給shark連結，即時提供一些存在於你網站內的美食資訊給使用者)，另外一種就是讀取本機已寫好的檔案，而最後一種就是以變數的方式直接設定回應的內容。有一點要補充的就是目前回應的資料都是以JSON的格式來設定。 如果你有意願幫忙加入一些有趣的機器人規則的話(像是來個人工智慧的機器人，或是定時發噗之類的)，麻煩參考一下我在github的資料並參考我簡介頁面的信箱來信。 另外就是，因為我還在學習團隊合作的方法，所以可能在寫法或是想法上有一些較主觀的成份在，歡迎大家給我一些建議與意見，讓我也能和大家一起學習，感謝。]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphp-shark-%25e6%2594%25b9%25e7%2589%2588.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/php-shark-%e6%94%b9%e7%89%88.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/php-shark-%e6%94%b9%e7%89%88.html"  data-text="[PHP] Shark 改版" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><div style="text-align:center"><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/1267799398_wireshark.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/1267799398_wireshark.png" alt="" title="1267799398_wireshark" width="128" height="128" class="alignnone size-full wp-image-346" /></a></div>
<p><br/><br />
目前shark計畫正在做大規模的改版(加入了sharkCore Class及模組抽換)，不過因為機器人的需求各式各樣，所以想要利用大家的能力來收集一些已經寫好的規則並整合至shark內。以我自己為例，我目前做了<span style="color:red">「對特定關鍵字的噗做一次性回覆」</span>這個規則(可能的應用如<span style="color:blue">「小籤籤的抽籤功能」</span>、<span style="color:blue">「占卜功能」</span>、<span style="color:blue">「食我機器人」</span>…等)，允許使用者自行定義關鍵字、Qualifier、還有回應、以及回應用的Qualifier，另外在03/06的時候我又做好了一個<span style="color:red">「在特定時間發噗」</span>的規則(相關的應用如<span style="color:blue">「定時亂喇賽來維持karma」</span>、<span style="color:blue">「定時發自訂的消息」</span>…等)，可以一次定義多時段的發噗內容，例如說我可以在每天十二點問大家吃飯沒，同時每一小時會發出天氣預報。<br />
<br/><br />
同時也實作了三種方法來抓取「回應」的內容，你可以把回應的內容放在網路上以檔案的形式呈現，或是你也可以為你的網站設立一個API的接口，透過HTTP的方式去讀你網站的資料(例如你的網站是有關於美食的，你就可以提供一個接口給shark連結，即時提供一些存在於你網站內的美食資訊給使用者)，另外一種就是讀取本機已寫好的檔案，而最後一種就是以變數的方式直接設定回應的內容。<span style="color:red;">有一點要補充的就是目前回應的資料都是以JSON的格式來設定</span>。<br />
<br/><br />
如果你有意願幫忙加入一些有趣的機器人規則的話(像是來個人工智慧的機器人，或是定時發噗之類的)，麻煩參考一下我在<a href="http://github.com/EragonJ/shark">github</a>的資料並參考我簡介頁面的信箱來信。<br />
<br/><br />
另外就是，因為我還在學習團隊合作的方法，所以可能在寫法或是想法上有一些較主觀的成份在，歡迎大家給我一些建議與意見，讓我也能和大家一起學習，感謝。<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/php-shark-%e6%94%b9%e7%89%88.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] optimization for shortening the API calls</title>
		<link>http://eragonj.hax4.in/blog/php-optimization-for-shortening-the-api-calls.html</link>
		<comments>http://eragonj.hax4.in/blog/php-optimization-for-shortening-the-api-calls.html#comments</comments>
		<pubDate>Sat, 20 Feb 2010 16:21:39 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[delay]]></category>
		<category><![CDATA[plurk]]></category>
		<category><![CDATA[Shark]]></category>
		<category><![CDATA[sleep]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[北極熊]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=297</guid>
		<description><![CDATA[Tweet 最近為了降低API calls，所以在Shark內加入了一個Method可以讓使用者自行依自己的需要來延遲整個程式的執行： 參數是所需延遲的秒數，0就是不延遲。 雖然這裡沒有什麼技術上的難度，講白點就是丟給sleep()去跑而已，但是我想討論的是它所造成的影響。先看一下下面的統計圖： 2/14和2/15是平常的情況，所謂的平常就是用無窮迴圈去跑Bot，只算「登入」和「基本檢查」這幾個動作，而已，就會拉高整個呼叫API的情況，非常的跨張，這就是為什麼北極冰山快融化完的關係，因為大家只要寄個信給Plurk官方就可以突破原先50000次的限制，要怎麼用就怎麼用，非常爽快。 但是再看看2/18和2/19的時候，這是我讓Shark加入了延遲的動作，我記得是設3秒鐘，夠誇張吧，直接下降到23000的次數了，你連寫信去Plurk的動作都省下來了，還有27000次讓你做別的事情，這樣不是很開心嗎!? (大約下降了78%..)，真是從小處著手，就有很大的改變呢&#8230;(忘了說，使用者很難感受到機器人回覆plurks的時間差，一樣很快) 所以麻煩大家不要一直用「while(true)」或是「for(;;)」這樣子的東西，要用的話至少也要加個中止條件或是延遲，不僅可以減少系統資源的開銷，還可以保護北極熊不會因此死光&#8230;]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphp-optimization-for-shortening-the-api-calls.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/php-optimization-for-shortening-the-api-calls.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/php-optimization-for-shortening-the-api-calls.html"  data-text="[PHP] optimization for shortening the API calls" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>最近為了降低API calls，所以在Shark內加入了一個Method可以讓使用者自行依自己的需要來延遲整個程式的執行：</p>
<p><script src="http://gist.github.com/309735.js?file=gistfile1.php"></script></p>
<p>參數是所需延遲的秒數，0就是不延遲。<br />
<br/><br />
雖然這裡沒有什麼技術上的難度，講白點就是丟給sleep()去跑而已，但是我想討論的是它所造成的影響。先看一下下面的統計圖：<br />
<br/><br />
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/02/APIcalls.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/02/APIcalls.png" alt="" title="APIcalls" width="222" height="228" class="alignnone size-full wp-image-298" /></a><br />
<br/><br />
2/14和2/15是平常的情況，所謂的平常就是用無窮迴圈去跑Bot，只算「登入」和「基本檢查」這幾個動作，而已，就會拉高整個呼叫API的情況，非常的跨張，這就是為什麼北極冰山快融化完的關係，因為大家只要寄個信給Plurk官方就可以突破原先50000次的限制，要怎麼用就怎麼用，非常爽快。<br />
<br/><br />
但是再看看2/18和2/19的時候，這是我讓Shark加入了延遲的動作，我記得是設3秒鐘，夠誇張吧，直接下降到23000的次數了，你連寫信去Plurk的動作都省下來了，還有27000次讓你做別的事情，這樣不是很開心嗎!? (大約下降了78%..)，真是從小處著手，就有很大的改變呢&#8230;(忘了說，使用者很難感受到機器人回覆plurks的時間差，一樣很快)<br />
<br/><br />
所以麻煩大家不要一直用「while(true)」或是「for(;;)」這樣子的東西，要用的話至少也要加個中止條件或是延遲，不僅可以減少系統資源的開銷，還可以保護北極熊不會因此死光&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/php-optimization-for-shortening-the-api-calls.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Shark &#8211; 整合性 plurk bot</title>
		<link>http://eragonj.hax4.in/blog/php-shark-%e6%95%b4%e5%90%88%e6%80%a7-plurk-bot.html</link>
		<comments>http://eragonj.hax4.in/blog/php-shark-%e6%95%b4%e5%90%88%e6%80%a7-plurk-bot.html#comments</comments>
		<pubDate>Sun, 07 Feb 2010 06:53:37 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[plurk]]></category>
		<category><![CDATA[Shark]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=188</guid>
		<description><![CDATA[Tweet 圖 from here 這是我最近一直在做的東西，也許是因為之前「JaceJu」的那堂課讓我對物件導向的模式有點嚮往，所以就試著用用看物件導向的概念在這次的專案下，先來介紹一下這個玩具吧： 一開始我是看到朋友們一直在討論plurk bot這個玩具，所以就想說來做個什麼（其實我就是一個很怪的人，我很多做出來的小玩具都是因為看到人家的討論串才開始做的，而這次也不例外XD），因此就想打造一個整合性的plurk bot，而不是只為了特定功能而實作的東西。我想可能也是受到Hax4理念的刺激，為了製作出讓人家覺得有趣又好玩的東西，所以我們必需把最麻煩的部分都實現並封裝起來，就算使用者不是一個程式設計師（我也不是XD），也能夠輕易的上手，這就是我的想法。 實作的部分，因為我是在PHP下做的，所以就沿用官方認可的php-plurk-api，用他們已經實作好的API去和官方做溝通，這真的是省事很多，這樣我就不用自己刻一個爛爛的介面來用了，也提昇了穩定度。因此整個Shark class是直接繼承它的類別，再設計新的骨架在其之上，一來我可以開心的使用API，連第三層的使用者也能輕易的使用（繼承真的是很神，更神的是所有在plur-api下的Method都是protected的，大家都可以開心用XD），所以這樣一來我沒有破壞到它原始的架構，反而再多建了一些我想做的東西讓大家玩，這樣真酷! 講這麼多，快點上我在Github上的Shark專案把相關的核心抓下來玩玩看吧，忘了說，我本意是想讓大家都可以輕易做像是「小籤籤」的plurk bot，可以自動回覆一些特定資訊，而一些設定的細節就麻煩去看我寫好的說明啦，如果對這個專案有什麼建議的話，麻煩直接回信到我的信箱並在主旨打「About: Shark」，我就會盡快回覆你的。 感謝你的觀看XD。 δ 目前Shark有改版的資料並徵求有志之士來寫好玩的規則，請看站內的另一篇文 δ 整個專案是相容於php_plurk_api 1.4，但是目前最新是1.4.2版，這點要注意一下。]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphp-shark-%25e6%2595%25b4%25e5%2590%2588%25e6%2580%25a7-plurk-bot.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/php-shark-%e6%95%b4%e5%90%88%e6%80%a7-plurk-bot.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/php-shark-%e6%95%b4%e5%90%88%e6%80%a7-plurk-bot.html"  data-text="[PHP] Shark &#8211; 整合性 plurk bot" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><div style="text-align:right;">圖 from <a href="http://castnet.nctu.edu.tw/view.htm?ar_pk=1612">here</a></div>
<div style="text-align:center;">
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/02/shark.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/02/shark.png" alt="" title="shark" width="128" height="128" class="aligncenter size-full wp-image-612" /></a>
</div>
<p><br/><br />
這是我最近一直在做的東西，也許是因為之前「JaceJu」的那堂課讓我對物件導向的模式有點嚮往，所以就試著用用看物件導向的概念在這次的專案下，先來介紹一下這個玩具吧：<br />
<br/><br />
一開始我是看到朋友們一直在討論plurk bot這個玩具，所以就想說來做個什麼（其實我就是一個很怪的人，我很多做出來的小玩具都是因為看到人家的討論串才開始做的，而這次也不例外XD），因此就想打造一個整合性的plurk bot，而不是只為了特定功能而實作的東西。我想可能也是受到Hax4理念的刺激，為了製作出讓人家覺得有趣又好玩的東西，所以我們必需把最麻煩的部分都實現並封裝起來，就算使用者不是一個程式設計師（我也不是XD），也能夠輕易的上手，這就是我的想法。<br />
<br/><br />
實作的部分，因為我是在PHP下做的，所以就沿用官方認可的php-plurk-api，用他們已經實作好的API去和官方做溝通，這真的是省事很多，這樣我就不用自己刻一個爛爛的介面來用了，也提昇了穩定度。因此整個Shark class是直接繼承它的類別，再設計新的骨架在其之上，一來我可以開心的使用API，連第三層的使用者也能輕易的使用（繼承真的是很神，更神的是所有在plur-api下的Method都是protected的，大家都可以開心用XD），所以這樣一來我沒有破壞到它原始的架構，反而再多建了一些我想做的東西讓大家玩，這樣真酷!<br />
<br/><br />
講這麼多，快點上我在<a href="http://github.com/EragonJ/shark">Github上的Shark專案</a>把相關的核心抓下來玩玩看吧，忘了說，我本意是想讓大家都可以輕易做像是「小籤籤」的plurk bot，可以自動回覆一些特定資訊，而一些設定的細節就麻煩去看我寫好的說明啦，如果對這個專案有什麼建議的話，麻煩直接回信到我的信箱並在主旨打「About: Shark」，我就會盡快回覆你的。</p>
<p>感謝你的觀看XD。</p>
<p>δ 目前Shark有改版的資料並徵求有志之士來寫好玩的規則，請看站內的<a href="http://eragonj.hax4.in/?p=337">另一篇文</a><br />
δ 整個專案是相容於php_plurk_api 1.4，但是目前最新是1.4.2版，這點要注意一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/php-shark-%e6%95%b4%e5%90%88%e6%80%a7-plurk-bot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hax4] Rainbow</title>
		<link>http://eragonj.hax4.in/blog/hax4-rainbow.html</link>
		<comments>http://eragonj.hax4.in/blog/hax4-rainbow.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 18:18:50 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Hax4]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[rainbow]]></category>
		<category><![CDATA[嘸蝦米]]></category>
		<category><![CDATA[嘸蝦米快打]]></category>
		<category><![CDATA[快樂學打字]]></category>
		<category><![CDATA[打字]]></category>
		<category><![CDATA[輕鬆學會嘸蝦米]]></category>
		<category><![CDATA[輸入法]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=91</guid>
		<description><![CDATA[Tweet 測試頁面：在這、專案資訊：在這 這幾天因為心血來潮，想說來練習一下pure javascript，所以就都不用jQuery來做事情(雖然最後還是有用，不過我只用來做特效而已XD)。這個Idea其實是源於我以前做的一個很爛的liu-translator，它只能單方面做字根對字的轉換，所以就想說利用Ajax的概念來實作一個線上的IME，因此我就去找了之前Luke的網蝦米來研究他的UI介面。 研究了一下後就開始著手動工整個JS的架構，邊看深入淺出Ajax邊試著實作他說的一些思惟，像是要怎麼寫的很MVC，所以就開始學著把程式切成粗略的「資料」、「模組」、「樣式」三類，雖然之間還是有些耦合性，但是比較以前的我，這次的實作算是很成功的分離了。 之後又想到行易公司的練習嘸蝦米的打字程式一直沒有跨平台，只支援該死的M$，所以為何不幫他們設計一個Cross Platform的Web Application?反正只要解決Cross Browser的問題就可以了，雖然我在Cross Browser這條路上只是一個剛入門的新手，但總比Cross Platform好多了吧&#8230;因此就把分離完的架構再修改，改成有點像是遊戲的小程式。 原本已經接近完工的狀態了，但是Bu因為是「大新倉頡」的愛好者，所以就給個建議要我加入的其字根對應表，去擴充可支援的輸入法，就又經過了一場編碼和正規表達式的戰爭後，終於把切換輸入法的功能也加上了，這完全要歸因於先前的偽MVC架構，讓我能夠在很短的時間完成這個動作。 最後一個也是最重要的啦，為了提高遊戲性，我設計了一段可以自動去抓使用者給定URL的頁面回來，把該頁面上所有符合UTF-8繁體中文的字全部抓下來當成題目，這又比起以前行易公司設計的那些題目多了一些趣味。多了這個設計，你還可以邊看Yahoo!奇摩新聞邊練打字咧!! 附上程式截圖: §2010/05/13 補上程式的Demo連結，原來我都沒有放出來= = ，舊的在這，新的在這 §2011/02/05 更新連結、圖片、介紹。]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fhax4-rainbow.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/hax4-rainbow.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/hax4-rainbow.html"  data-text="[Hax4] Rainbow" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>測試頁面：<a href="http://eragonj.hax4.in/toys/Rainbow/index.html">在這</a>、專案資訊：<a href="https://github.com/EragonJ/rainbow">在這</a><br />
<br/><br />
這幾天因為心血來潮，想說來練習一下pure javascript，所以就都不用jQuery來做事情(雖然最後還是有用，不過我只用來做特效而已XD)。這個Idea其實是源於我以前做的一個很爛的liu-translator，它只能單方面做字根對字的轉換，所以就想說利用Ajax的概念來實作一個線上的IME，因此我就去找了之前<a href="http://liu.twbbs.org/hliu/">Luke的網蝦米</a>來研究他的UI介面。<br />
<br/><br />
研究了一下後就開始著手動工整個JS的架構，邊看深入淺出Ajax邊試著實作他說的一些思惟，像是要怎麼寫的很<a href="http://zh.wikipedia.org/zh-tw/MVC">MVC</a>，所以就開始學著把程式切成粗略的「資料」、「模組」、「樣式」三類，雖然之間還是有些耦合性，但是比較以前的我，這次的實作算是很成功的分離了。<br />
<br/><br />
之後又想到行易公司的練習嘸蝦米的打字程式一直沒有跨平台，只支援該死的M$，所以為何不幫他們設計一個Cross Platform的Web Application?反正只要解決Cross Browser的問題就可以了，雖然我在Cross Browser這條路上只是一個剛入門的新手，但總比Cross Platform好多了吧&#8230;因此就把分離完的架構再修改，改成有點像是遊戲的小程式。<br />
<br/><br />
原本已經接近完工的狀態了，但是Bu因為是「大新倉頡」的愛好者，所以就給個建議要我加入的其字根對應表，去擴充可支援的輸入法，就又經過了一場編碼和正規表達式的戰爭後，終於把切換輸入法的功能也加上了，這完全要歸因於先前的<del datetime="2010-01-26T17:29:12+00:00">偽</del>MVC架構，讓我能夠在很短的時間完成這個動作。<br />
<br/><br />
最後一個也是最重要的啦，為了提高遊戲性，我設計了一段可以自動去抓使用者給定URL的頁面回來，把該頁面上所有符合UTF-8繁體中文的字全部抓下來當成題目，這又比起以前行易公司設計的那些題目多了一些趣味。多了這個設計，你還可以邊看Yahoo!奇摩新聞邊練打字咧!!<br />
<br/></p>
<p>附上程式截圖:</p>
<p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/11.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/11.png" alt="" title="圖片 1" width="300" height="173" class="alignnone size-medium wp-image-96" /></a><br />
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/21.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/21.png" alt="" title="圖片 1" width="300" height="173" class="alignnone size-medium wp-image-96" /></a><br />
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/3.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/01/3.png" alt="" title="圖片 1" width="300" height="173" class="alignnone size-medium wp-image-96" /></a><br />
<a href="https://github.com/EragonJ/rainbow/raw/js/snap/js1.png"><img src="https://github.com/EragonJ/rainbow/raw/js/snap/js1.png" alt="" title="圖片 4" width="300" height="173" class="alignnone size-medium wp-image-96" /></a></p>
<p>§2010/05/13 補上程式的Demo連結，原來我都沒有放出來= = ，舊的<del datetime="2011-02-05T15:46:34+00:00"><a href="http://rainbow.hax4.in">在這</a></del>，新的<a href="http://eragonj.hax4.in/toys/Rainbow/index.html">在這</a><br/><br />
§2011/02/05 更新連結、圖片、介紹。</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/hax4-rainbow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Mac] How to enable GD lib ?</title>
		<link>http://eragonj.hax4.in/blog/mac-how-to-enable-gd-lib.html</link>
		<comments>http://eragonj.hax4.in/blog/mac-how-to-enable-gd-lib.html#comments</comments>
		<pubDate>Mon, 18 Jan 2010 16:31:42 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[Hax4]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=86</guid>
		<description><![CDATA[Tweet 意外找到這個開發者寫的pkg檔，真的是一裝就Happy Ending了，省下不少時間， 以下是該pkg檔的特色，記下來給以後有需要的人!! 連結 the MySQL and PostgreSQL databases the cURL library for various communications protocols the GD image creation library (with PNG, JPEG, PostScript Type 1 and TrueType font options). the expat XML parser and WDDX support XSLT transformations LDAP access the IMAP client library mcrypt encryption functions GNU gettext]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fmac-how-to-enable-gd-lib.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/mac-how-to-enable-gd-lib.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/mac-how-to-enable-gd-lib.html"  data-text="[Mac] How to enable GD lib ?" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>意外找到這個開發者寫的pkg檔，真的是一裝就Happy Ending了，省下不少時間，</p>
<p>以下是該pkg檔的特色，記下來給以後有需要的人!!</p>
<p><a href="http://www.entropy.ch/software/macosx/php/">連結</a></p>
<ul>
<li>the <a href="http://www.php.net/manual/en/ref.mysql.php">MySQL</a> and <a href="http://www.php.net/manual/en/ref.pgsql.php">PostgreSQL</a> databases</li>
<li>the <a href="http://www.php.net/manual/en/ref.curl.php">cURL</a> library for various communications protocols</li>
<li>the <a href="http://www.php.net/manual/en/ref.image.php">GD</a> image creation library (with PNG, JPEG, PostScript Type 1 and TrueType font options).</li>
<li>the <a href="http://www.php.net/manual/en/ref.xml.php">expat XML parser</a> and <a href="http://www.php.net/manual/en/ref.wddx.php">WDDX</a> support</li>
<li><a href="http://www.php.net/manual/en/ref.xslt.php">XSLT</a> transformations</li>
<li><a href="http://www.php.net/manual/en/ref.ldap.php">LDAP</a> access</li>
<li>the <a href="http://www.php.net/manual/en/ref.imap.php">IMAP</a> client library</li>
<li><a href="http://www.php.net/manual/en/ref.mcrypt.php">mcrypt</a> encryption functions</li>
<li>GNU gettext</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/mac-how-to-enable-gd-lib.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] phpMyAdmin #2002 error</title>
		<link>http://eragonj.hax4.in/blog/php-phpmyadmin-2002-error.html</link>
		<comments>http://eragonj.hax4.in/blog/php-phpmyadmin-2002-error.html#comments</comments>
		<pubDate>Wed, 16 Sep 2009 21:08:00 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[#2002]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=30</guid>
		<description><![CDATA[Tweet Environment : Mac OSX 10.5.8PHP 5.2.10Mysql 5.0.82phpMyAdmin 3.1.3 Error: #2002 &#8211; The server is not responding (or local MySQL server&#8217;s socket is not correctly configured) Solution]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphp-phpmyadmin-2002-error.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/php-phpmyadmin-2002-error.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/php-phpmyadmin-2002-error.html"  data-text="[PHP] phpMyAdmin #2002 error" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Environment :<br />
<blockquote>Mac OSX 10.5.8<br />PHP 5.2.10<br />Mysql 5.0.82<br />phpMyAdmin 3.1.3</p></blockquote>
<p>Error:<br />
<blockquote>#2002 &#8211; The server is not responding (or local MySQL server&#8217;s socket is not correctly configured)</p></blockquote>
<p><span style="font-weight:bold;"><a href="http://rondoyoyo.pixnet.net/blog/post/23327783">Solution</a></span>
<div><b><br /></b></div>
<div><b><br /></b></div>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/php-phpmyadmin-2002-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Wxetch bot 三連發</title>
		<link>http://eragonj.hax4.in/blog/wxetch-bot-%e4%b8%89%e9%80%a3%e7%99%bc.html</link>
		<comments>http://eragonj.hax4.in/blog/wxetch-bot-%e4%b8%89%e9%80%a3%e7%99%bc.html#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:36:00 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[Wxetch]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=17</guid>
		<description><![CDATA[Tweet 昨天意外的看到一個討論串 , 就在那邊寫了一個新的 Wxetch Tricker 寫到三點&#8230;原因是因為有些地方一直卡住才卡這麼晚 , 囧&#8230; A &#8211; Wxetch Tricker 是能夠用中花電信的 proxy server 來做到 cheating 的作用 &#60;?php if(isset($_POST['url'])){ $cookie = 'cookie.txt'; $url = trim($_POST['url']); $pattern = "/www.wretch.cc/blog/(.*)/i"; if((preg_match($pattern,$url,$last))==TRUE){ $url = $last[1]; } for($i=0;$i&#60;25;$i++){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"www.wretch.cc/blog/$url"); curl_setopt($ch,CURLOPT_PROXY,"proxy.hinet.net"); curl_setopt($ch,CURLOPT_PROXYPORT,80); curl_setopt($ch,CURLOPT_TIMEOUT,5); curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']); curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie); curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_exec($ch); curl_close($ch); } }else{ echo ' &#60;html&#62; &#60;head&#62; [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fwxetch-bot-%25e4%25b8%2589%25e9%2580%25a3%25e7%2599%25bc.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/wxetch-bot-%e4%b8%89%e9%80%a3%e7%99%bc.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/wxetch-bot-%e4%b8%89%e9%80%a3%e7%99%bc.html"  data-text="[PHP] Wxetch bot 三連發" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>昨天意外的看到一個討論串 , 就在那邊寫了一個新的 Wxetch Tricker 寫到三點&#8230;原因是因為有些地方一直卡住才卡這麼晚 , 囧&#8230;</p>
<p>A &#8211; Wxetch Tricker </p>
<p>是能夠用中花電信的 proxy server 來做到 cheating 的作用</p>
<p><code><br />&lt;?php<br /> if(isset($_POST['url'])){</p>
<p>  $cookie = 'cookie.txt';<br />  $url = trim($_POST['url']);<br />  $pattern = "/www.wretch.cc/blog/(.*)/i";</p>
<p>  if((preg_match($pattern,$url,$last))==TRUE){<br />   $url = $last[1];<br />  }<br />  for($i=0;$i&lt;25;$i++){<br />   $ch = curl_init();<br />   curl_setopt($ch,CURLOPT_URL,"www.wretch.cc/blog/$url");<br />   curl_setopt($ch,CURLOPT_PROXY,"proxy.hinet.net");<br />   curl_setopt($ch,CURLOPT_PROXYPORT,80);<br />   curl_setopt($ch,CURLOPT_TIMEOUT,5); <br />   curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);<br />   curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie);<br />   curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie);<br />   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);<br />   curl_exec($ch);<br />   curl_close($ch);<br />  }<br /> }else{<br />  echo '<br />  &lt;html&gt;<br />  &lt;head&gt;<br />  &lt;title&gt;Wxetch Tricker&lt;/title&gt;<br />  &lt;/head&gt;<br />  &lt;body&gt;<br />   &lt;form method="post" action="tricker.php"&gt;<br />    請輸入Wxetch帳號:&lt;input type="text" name="url" value=""&gt;<br />          &lt;input type="submit" name="click" value="click"&gt;<br />    ....default: 50 times<br />   &lt;/form&gt;<br />   &lt;div align="right"&gt;Author: EragonJ&lt;/div&gt;<br />  &lt;/body&gt;<br />  &lt;/html&gt;<br />  ';<br /> }<br />?&gt;<br /></code></p>
<p>因為這個要是中花電信的用戶才能使用他們的proxy server , 不過台灣還蠻多用戶的ISP都是他 , 所以應該都可以做到就是了!</p>
<p>我一直在想 , proxy server 不過就是個中繼站嗎? 那這樣子的話是怎麼可能做到cheating的功效 , 如果我推論沒錯的話 proxy.hinet.net:80 這是主要的server , 其下還有很多子server可以供主server 發佈命令去做中繼的動作 , 所以就可以做到cheating的功用 ,因為是由各個子proxy server去和Wxetch做接觸的!!</p>
<p>就算是小量cheating的動作就是了..</p>
<p>B &#8211; Wxetch Observer </p>
<p>有兩個版本 , 一個是<a href="http://myweb.ncku.edu.tw/~f4496103/wretch/catch-b.php">Full size version</a><br />而另一個是<a href="http://myweb.ncku.edu.tw/~f4496103/wretch/catch-a.php">Short cut version</a></p>
<p>這兩個都是可以直接去抓取相簿圖片的小程式 , 但是該死的IE6用右鍵會抓不到圖 , 但FF就沒有這個問題 , 可以來用用看FF3呀XD~ 真的是現在都用這個了~ 超好用 , 又有很多add-ons</p>
<p>大概就是這三個啦 , 下次還有什麼有趣的東西再放出來~</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/wxetch-bot-%e4%b8%89%e9%80%a3%e7%99%bc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] PHPmailer</title>
		<link>http://eragonj.hax4.in/blog/phpmailer.html</link>
		<comments>http://eragonj.hax4.in/blog/phpmailer.html#comments</comments>
		<pubDate>Wed, 10 Sep 2008 17:20:00 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHPmailer]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=4</guid>
		<description><![CDATA[Tweet 今天第一次用PHPmailer，為了學著用線上寄信的功能。 而這在經過多次設定後，發現了很多問題= =&#8221; ，因為不太會玩嘛~ 由於本機沒有裝SMTP Server ，所以就借用Google的SMTP Server來實現。 1.剛開始要先include class.phpmailer.php (自行去官網下載最新版的) 2.還要再inlcude class.smtp.php(都在同一個壓縮檔內) 3.setting $mail = new PHPMailer();$mail->IsSMTP();$mail->SMTPAuth = true; //啟用SMTP認証$mail->SMTPSecure = "ssl"; //以SSL加密連線$mail->Host = "smtp.gmail.com"; // Gmail的SMTP Server address$mail->Port = 465; // Gmail的SMTP port $mail->Username = "xxxx@gmail.com"; // GMAIL 帳號$mail->Password = "xxxxxx"; // GMAIL 密碼 $mail->From = "xxxx"; //從誰寄來$mail->FromName = "First Last"; //從誰寄來(名字)$mail->Body [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fphpmailer.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/phpmailer.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/phpmailer.html"  data-text="[PHP] PHPmailer" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>今天第一次用PHPmailer，為了學著用線上寄信的功能。</p>
<p>而這在經過多次設定後，發現了很多問題= =&#8221; ，因為不太會玩嘛~</p>
<p>由於本機沒有裝SMTP Server ，所以就借用Google的SMTP Server來實現。</p>
<p>1.剛開始要先include class.phpmailer.php (自行去官網下載最新版的)</p>
<p>2.還要再inlcude class.smtp.php(都在同一個壓縮檔內)</p>
<p>3.setting</p>
<p><code class="c"><br />$mail  = new PHPMailer();<br />$mail->IsSMTP();<br />$mail->SMTPAuth   = true;                                                     //啟用SMTP認証<br />$mail->SMTPSecure = "ssl";                                                   //以SSL加密連線<br />$mail->Host       = "smtp.gmail.com";                                     // Gmail的SMTP Server address<br />$mail->Port       = 465;                                                              // Gmail的SMTP port</p>
<p>$mail->Username   = "xxxx@gmail.com";                            // GMAIL 帳號<br />$mail->Password   = "xxxxxx";                                              // GMAIL 密碼</p>
<p>$mail->From       = "xxxx";                                                      //從誰寄來<br />$mail->FromName   = "First Last";                                       //從誰寄來(名字)<br />$mail->Body       = "Hey buddy, heres an email!";               //信件內容<br />$mail->Subject    = "PHPMailer Test Subject via gmail";   //信件主旨</p>
<p>$mail->WordWrap   = 50;                                                       // 設定斷字的長度</p>
<p>$mail->AddAddress("recept@mail.com", "John Doe");     //設定收件人的Email和Name</p>
<p>$mail->setLanguage('zh');                                                      //我自己翻譯的中文錯誤訊息(可不加)</p>
<p>if(!$mail->Send()) {                                                                 //寄信成功與否<br />echo "Mailer Error: " . $mail->ErrorInfo;<br />} else {<br />echo "Message sent!";<br />}<br /></code><br />基本上這樣設定就沒有問題了，下次再打我研究出來的結果。</p>
<p>可以留言討論呀:D~</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/phpmailer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

