How can I pull Google Voice data?

Google Voice has XML URLs so I was wondering how somebody would pull the JSON part from the returned XML and parse it out to a page. Google Voice's search capability is busted right now and I want to get access to my history. I'm thinking that a synchronous call to all of the pages up to the last known page number in my history should do it...

Answers


This may be your best bet...

Read about dataType conversion here: http://api.jquery.com/extending-ajax/

Particularly the section that says:

You can define converters "inline," inside the options of an ajax call. For example, the following code requests an XML document, then extracts relevant text from it, and parses it as "mydatatype":

$.ajax( url, {
  dataType: "xml text mydatatype",
  converters: {
    "xml text": function( xmlValue ) {
      // Extract relevant text from the xml document
      return textValue;
    }
  }
});

I don't know if this exact code snippet will return the JSON content properly, but at the very least it should strip it out of the XML response (you may need to add additional code to parse the returned "textValue" as JSON. Perhaps using the jQuery parseJSON method.

Maybe try:

$.ajax( url, {
  dataType: "xml text mydatatype",
  converters: {
    "xml text": $.parseJSON;
    }
  }
});

Hope this helps.


XML and JSON are not the same data types. You will likely have to process the data as XML, if that's the only type your data is returned as. If the URL has .xml, you might try changing it to .json to see if it returns a JSON data type.

If you give us more information (examples, URLs, etc), someone might be able to help you better.


Need Your Help

can't post from app to another app in server side

ruby-on-rails post routes

I have 2 apps running on my localhost on port 3000 and 9000 (rails 2 and sinatra app).

Confusion with HTTPWEBREQUEST

c# winforms visual-studio-2010

I get a connection list sometime 70 people in the list sometime 1000 , i put a loop on it and start getting them one by one using HTTPWEBREQUEST, and i have a textbox that keeps showing me where i ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.