Saturngod

What's on my mind

Get Total follower with Twitter API

It's very easy. see the code. I recommend to use with XML for twitter api. XML feedback is more faster than json.
<?php

$toopen="http://twitter.com/users/show.xml?screen_name=saturngod ";

$ch = curl_init(); /// initialize a cURL session
curl_setopt($ch, CURLOPT_URL, $toopen );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec ($ch);//end get cool feedburner count
curl_close($ch);

$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->loadXML($content);
$count=$dom->getElementsByTagName("followers_count")->item(0)->nodeValue;
$twitt=$dom->getElementsByTagName("text")->item(0)->nodeValue;

?>

Get subscriber count with feedburner API

Today, I want to add feed count from feedburner , in my blog. So, I need to write code using feedburner api. It's not easy.
  1. login your feedburner and go to your feed.
  2. Go to Publicize tag
  3. Go to Awareness Api and active it. Now, time for coding. change your id in uri of $toopen. In the code, I use saturngoden.

$ch = curl_init(); /// initialize a cURL session curl_setopt($ch, CURLOPT_URL, $toopen ); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec ($ch);//end get cool feedburner count curl_close($ch);

$dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadXML($content); $count=$dom->getElementsByTagName("entry")->item(0)->getAttribute("circulation"); echo $count; ?>

Ornagai

Ornagai is a english to myanmar , myanmar to english dictionary. Ornagai use CodeIgniter PHP Framework, MySQL and apache. Ornagai is a specialize for Myanmar Search. It's include Normalization system and syllable breaking system for Myanamar chracter. So, it will show same result &#4096;-&#4141;-&#4143; (u1000u102Du102F) and  &#4096;-&#4143;-&#4141; (u1000u102Fu102D) because of normalization . &#4096;&#4141; (u1000u102D) result will not show &#4096;&#4141;&#4143; (u1000u102Du102F) result because of syllable breaking. You can add new word when you can't find.

Technology

Apiwork

I gave my framework name is apiwork because it just design for api. I made api library for Google,Twitter, Facebook and I hope i will add more in my framework. It’s my private framework and it just use in my work. In the previous two week, I tooke a time for Google API with oAuth. Now, I totally understand and I made my own class for Google API and gxml_parser class. Gxml parser class for retrive the data from atom and xml for google api. 

My framework totally look like CodeIgniter because I’m cary on CI. haha… it true… let check this code.

$this->load->model(“mymodel”);

I got this idea from CodeIgniter and I’m making MVC and totally base on CI frarmework design. So, syntax look like CI. By the way, today I new codaset git hosting. I can use private hosting in there. Codaset still beta and it will be charge for host. I host my apiwork code in there. Github is nice for Git Hosting but private hosting price is not cheap. I just use for personal and not for business. So, I can give money to github and I use codaset :)

I also think about should I release my MV framework Draft ? No library. Just framework. So, some begineer may learn how to make MVC framework. Another thing, my framework’s library should use in native PHP like Zend. So, my co-worker can use in other project easily. Imm… need to do many things in my apiwork.

 

Authsub vs oAuth

**AuthSub**

Don’t need consumer key and secret

oAuth

Need consumer key and secret

AuthSub

Easy to use.

oAuth

need to knowledge about oAuth.

AuthSub

Session will expire.

oAuth

get the access token and secret and access all the time when untill user revoke the site.

Authsub

Use only in Google API. use for one time access.

oAuth

Use many in many API. Google, Twitter, etc. Use for grant access.

AuthSub

oAuth