Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HarvesterAsync extends AsyncTask <String, Void, String[]> {
- @Override
- protected String[] doInBackground(String... params) {
- String streamTitle = null;
- String songTitle = null;
- Scraper scraper = new ShoutCastScraper();
- List<Stream> streams = null;
- try {
- streams = scraper.scrape(new URI(params[0]));
- } catch (URISyntaxException e) {
- e.printStackTrace();
- } catch (ScrapeException e) {
- e.printStackTrace();
- }
- for (Stream stream: streams) {
- streamTitle = stream.getTitle();
- songTitle = stream.getCurrentSong();
- }
- return new String[] {streamTitle, songTitle};
- }
- @Override
- protected void onPostExecute(String[] s) {
- super.onPostExecute(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment