Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Google Bookmarks - any API to get them ???

66 views
Skip to first unread message
Message has been deleted
Message has been deleted

Manfred

unread,
Dec 19, 2006, 5:47:54 PM12/19/06
to
slishnevsky wrote:
> I wonder if there is any Google API that I can use to work with my
> Google Bookmarks ???
This is the discussion group for questions about implementing the
non-commercial, beta Google SOAP Search API.
For the list of Google APIs see http://code.google.com/apis.html

Manfred

Message has been deleted

Manfred

unread,
Dec 20, 2006, 8:23:46 AM12/20/06
to

slishnevsky wrote:
> """Manfred ÐÉÓÁÌ(Á):
> I don't understand what that means.

>
> I wonder if there is any Google API that I can use to work with my
> Google Bookmarks ???
This SOAP Search API is certainly not. I provided the link above
so you can read up yourself for all the other APIs.

Hope this helps,

Manfred

Ionut

unread,
Dec 22, 2006, 5:43:44 PM12/22/06
to
Google Bookmarks has RSS feeds. Do a normal search from your computer
and add "&output=rss" to get a feed.

To use this in an application, you need to have the username / password
of the user. This API should help:
http://code.google.com/apis/accounts/Authentication.html .

Manfred

unread,
Dec 22, 2006, 7:48:53 PM12/22/06
to
Ionut wrote:
> Google Bookmarks has RSS feeds. Do a normal search from your computer
> and add "&output=rss" to get a feed.
Excellent, thank you!

>
> To use this in an application, you need to have the username / password
> of the user. This API should help:
> http://code.google.com/apis/accounts/Authentication.html .
It seems that the Google Accounts API is not applicable to
Google Bookmarks. If this is the case, you may use HTTP/1.1
Digest Authentication.

Manfred

Message has been deleted
Message has been deleted

Manfred

unread,
Jan 3, 2007, 5:48:06 AM1/3/07
to
Would you mind to describe what you did in detail, otherwise it's
a guessing game.

Manfred

slishnevsky wrote:
> Update - I can get Google Bookmarks RSS in my application and display
> the data.
> However, All non-english letters are displayed as question marks.
> Something tricky with the encoding.
>
> I have another RSS in the same language (russian) on the same page, it
> shows just fine.
> In both cases RSS encoding is defined as utf-8.
>
> I can't understand why Google Bookmarks RSS shows "??????????" instead
> of russian letters.
>
> I am using ASP.NET 2.0 to display RSS data.
>
> Any advice would be appreciated. Thanks.

Message has been deleted
Message has been deleted

Manfred

unread,
Jan 4, 2007, 9:13:04 PM1/4/07
to
To debug this I would first check the input from Google.

You may want to check the response header from Google,
it should read
Content-type text/xml; charset=UTF-8
If _not_ you should check the corresponding request header.

Another way to check it would be the following:
a) manually log-in to your Google account
b) copy the url you provided into your Firefox browser
Can you see the Cyrillic characters ?

Manfred

slishnevsky wrote:
> Thanks Manfred,
> I'll just show my code in C# as it is, it's very simple:
>
> // Need this for authentication
> XmlUrlResolver resolver = new XmlUrlResolver();
> resolver.Credentials = new NetworkCredential("my google username", "my
> google password");
> XmlDocument document = new XmlDocument();
> document.XmlResolver = resolver;
> // Here I load Google Bookmarks RSS, ok
> document.Load("http://www.google.com/bookmarks/lookup?output=rss&sort=title&num=10000");
>
> /*
> Note, at this step debugger already shows me in document.InnerXml
> question marks instead of russian letters. I don't get it. Why? My Web
> config <globalization> section is emty, meaning everything is by
> default in utf-8, RSS itself is in utf-8, next, I just assign that rss
> data to the XmlDataSource component, and so on..., =but it doesn't
> really matter what happens next since I already got "????????" instead
> of letters
> */
>
> XmlDataSource datasource = new XmlDataSource();
> datasource.Data = document.InnerXml;
> datasource.XPath = "rss/channel/item";
> DataList1.DataSource = datasource;
> DataList1.DataBind();
>
> Note, if I don't make any changes in code, and instead of that google
> bookmarks rss I put another rss, like this one for example,
> http://mds.rpod.ru/rss.xml, then everything is just fine.
>
> I am very confused now. Thanks, Any advice would by appreciated.

Message has been deleted

Manfred

unread,
Jan 5, 2007, 12:02:59 PM1/5/07
to
slishnevsky wrote:
> Yes, in the browser (any) everything is fine.
O.k. --- But what about the request header ?

> In code, when I do this:
> document.Load("http://www.google.com/bookmarks/lookup?output=rss&sort=title&num=10000");
>
> I already get garbage in document.InnerXml.
>
> I though maybe I should check my eyes, I tried to save what I get:
> document.Save("bookmarks.xml").
>
> I check that file, it starts with <?xml version="1.0"
> encoding="utf-8"?>
> The file itself is saved as utf-8 - "Unicode (UTF-8 with signature) -
> Codepage 65001"
>
> Inside - garbage :( How the hell could that be?
Nothing new here - you wrote this same before.
Note. Saving the RSS locally and looking at the local copy does not
proof anything about the actual coding of the file. To be sure you
have to check it with a line trace.
You seem to rely too much on the XML declaration (which is
optional anyway). It's not the only or primary way to determine
the coding.

Manfred

Message has been deleted
Message has been deleted

Manfred

unread,
Jan 5, 2007, 4:19:09 PM1/5/07
to
slishnevsky wrote:
> So, what you are saying is that encoding utf-8 in this RSS may not be
> real encoding?
Yes, you better check it. About errors in feeds read
http://googlereader.blogspot.com/2005/12/xml-errors-in-feeds.html

> If so, why would they do that ?
It may be inadvertently triggered by your request. You have seen
already
correct feeds from Google bookmarks showing up in browsers.

> How can I find what is the real encoding of that RSS ?
If you have problems with checking the response headers, just
ask here. You may also trace the line.

If the response headers are correct, I would assume the encoding
is correct also. The next logical step would be to learn more about
the interface you are using and debugging it.

In any case, please don't forget to add here your final conclusions
about
this problem for the benefit of future readers!

Hope this helps, Manfred

Message has been deleted

Manfred

unread,
Jan 5, 2007, 6:54:31 PM1/5/07
to
> Anyway, here is the response header of that RSS (I copied it from
> VS2005 debugger):
> Content-Type: text/xml; charset=ISO-8859-1
This should have been
Content-Type: text/xml; charset=UTF-8

Your application is sending a request header to request the feed.
One of the headers sent is
Accept-Charset ISO-8859-1
with _no_ mention of utf-8 I suspect. You can send the web-server
a comma separated list (no blanks), and the web application can
choose from this list. For your purpose both
Accept-Charset utf-8
or
Accept-Charset ISO-8859-1,utf-8
will enable the Google Search-History HTTP Server
to send you the data in the correct UTF-8 encoding.
Note. If you find the Accept-Charset header containig
other parameters, just retain them and separate them
from the charset-list by a semi-colon (";", no blanks).

> I am sure that many RSSs contain error listed in that table. However, I
> don't follow how the browsers display them with no problem. What? They
> all have quite robust RSS analysis and correction engines or something
> like that?
No. But from what I wrote above you certainly got the idea: the
browsers
are sending the correct request-header.

In case you want to read more about the Hypertext Transfer
Protocol -- HTTP/1.1, see
http://www.w3.org/Protocols/rfc2616/rfc2616.html

Hope this helps, Manfred

Message has been deleted

Manfred

unread,
Jan 12, 2007, 5:48:50 PM1/12/07
to
> I tried, to do what you suggested, but no matter what I do, I always
> get exactly the same response, with exactly the same HTTP Header.
You should be able to check your _request_ header directly with some
tool (in Firefox for example, I use "Tamper Data"), just post it here
---
up to now you only showed me the _response_ header.

> HttpWebRequest request =
> (HttpWebRequest)WebRequest.Create("https://www.google.com/bookmarks/lookup?output=rss&sort=title&num=10");
> request.Credentials = new NetworkCredential("username", "password");
> request.Headers[HttpRequestHeader.AcceptCharset] = "utf-8";
In case the _request_ header is still wrong, just a wild guess. Is it
correct
to set the "request.Headers" _after_ the "WebRequest.Create" or should
you
set it before ??

Manfred

0 new messages