How to get a list of the nearest movie theaters depending on the zip code?

I need to find a list of the nearest theaters depending on the zipcode user input, I have an api that gives this information if we pass the zipcode but not sure how to use this api, this is my first time when I try to get data from the api and I am not familiar with atom, poxand astacronyms.

The theater-providing API is located at http://gateway.moviefone.com/ , any suggestion for guidance would be very helpful to start by using this api and understanding how to work with the api.

+3
source share
1 answer

, , :

String zip = "...";
String url = "http://gateway.moviefone.com/movies/pox/closesttheaters.xml?zip=" + zip;

// read and parse the xml
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(url);

//get elements you need
NodeList list = document.getElementsByTagName("closestTheatersUrl");
String urlForTheater = list.item(0).getNodeValue();
+2

All Articles