Hi, i am new to java and currently have this code and it does not seem able to retrieve information from twitters containing double quotations. It will cut off the remarks. Not sure how to include those comments in too. Can someone help? very urgent thanks
Example: @something " I need help!!"
the results returned is only: @something
Here is my code:
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
InputStream in = [COLOR=navy]**new**[/COLOR] URL([COLOR=red]"http://search.twitter.com/search.atom?q="[/COLOR] + search + [COLOR=red]"&page=1&rpp=100"[/COLOR]).openStream();
XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
[COLOR=navy]**boolean**[/COLOR] inEntry = [COLOR=navy]**false**[/COLOR];
Item currentItem = [COLOR=navy]**null**[/COLOR];
[COLOR=navy]**while**[/COLOR] (eventReader.hasNext()) [COLOR=navy]{[/COLOR]
XMLEvent event = eventReader.nextEvent();
[COLOR=navy]**if**[/COLOR] (event.isStartElement()) [COLOR=navy]{[/COLOR]
StartElement startElement = event.asStartElement();
[COLOR=navy]**if**[/COLOR] (event.asStartElement().getName().getLocalPart().equals([COLOR=red]"title"[/COLOR])) [COLOR=navy]{[/COLOR]
event = eventReader.nextEvent();
String title = event.asCharacters().getData();
[COLOR=navy]**if**[/COLOR] (!inEntry) [COLOR=navy]{[/COLOR]
channel.setTitle(title);[COLOR=darkgreen]//false[/COLOR]
[COLOR=navy]}[/COLOR] [COLOR=navy]**else**[/COLOR] [COLOR=navy]{[/COLOR]
currentItem.setTitle(title);[COLOR=darkgreen]//true[/COLOR]
[COLOR=navy]}[/COLOR]
[COLOR=navy]**continue**[/COLOR];