php - Obtain a Blogger's blog ID from its friendly URL without screen scraping -


i'm using blogger api php. want obtain blog id site's name.

for example, http://sleeptalkinman.blogspot.com/ has blog id of 3117168333067506122. possible blog id appears in source, screen scraping isn't idea!

is possible obtain through api instead of scraping html?

today, newest blogger api in version 3.0. new api, can blog id resource type getbyurl. full example using blog , api:

https://www.googleapis.com/blogger/v3/blogs/byurl?url=http%3a%2f%2fwww.ifaniqbal.com&key=aizasydnkr52esfobzi9bpkrtytbowoam7js9uy 

just ctrl+c example , ctrl+v browser test that. 1 of return field of example 'id' field, blog id want (in json), this:

{ "kind": "blogger#blog", "id": "7107469463017369923", "name": "ifan iqbal", "description": "tips, download, resensi, tutorial, blog, blogspot", "published": "2012-02-28t23:54:48+07:00", "updated": "2013-07-11t16:24:58+07:00", "url": "http://www.ifaniqbal.com/", "selflink": "https://www.googleapis.com/blogger/v3/blogs/7107469463017369923", "posts": {  "totalitems": 161,  "selflink": "https://www.googleapis.com/blogger/v3/blogs/7107469463017369923/posts" }, "pages": {  "totalitems": 2,  "selflink": "https://www.googleapis.com/blogger/v3/blogs/7107469463017369923/pages" }, "locale": {  "language": "in",  "country": "",  "variant": "" } 

}


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -