Is there an easy way to extract the raw data from a Blogger "page". For example, please see the following page:
http://ftaca.blogspot.com/p/get-support.html
I'd like to scrape everything from "Get Support" through "p 82 ACA text" (essentially, the meat of the page without the surrounding navs and such) for use in an Android app that is related to this website. Are there any querystrings that I can append to the URL to just get the raw info (i.e. something like http://ftaca.blogspot.com/p/get-support.html?raw=1)? I've tried a few things, but none work. Mind that this is a Blogger "page", and not a post per se.
Thanks,
Chris
I believe that this is what I need:
http://ftaca.blogspot.com/feeds/pages/default?alt=rss
Thanks everyone for your assistance!
You'll have to ask the web site developers whether they support query strings for page subsetting. That isn't really Android specific.
If they don't, you'll probably have to write a HttpClient client (search here and you'll find lots of good examples) to get the raw HTML for the page, and then subset it within your Android app.
Related
is that possible in Android to go though whatever link and get main content from that page(f.e.text) or whatever i want to get? If yes, how i can realize that?
There is couple ways to get data from websites.
First and maybe the most popular way is parsing RSS feed from webiste. Java and Android are providing couple parsers and ways to parse xml or in this case RSS Feed. You can take a look in this examples:
https://developer.android.com/samples/BasicSyncAdapter/src/com.example.android.basicsyncadapter/net/FeedParser.html
https://www.tutorialspoint.com/android/android_rss_reader.htm
Second way is getting needed informations from API if it is provided from webiste and offten that API will be in JSON format. For example https://openweathermap.org/ will return JSON file filled with informations of weather which you can pares into your app. Also Android and Java are providing couple ways to get informations from JSON format. You can take a look on this one:
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
Third you can use support library called Jsoup for parsing HTML from particular webiste/s. You can find examples how to parse HTML on their offical webiste: https://jsoup.org/
Maybe there is more ways certanly you should look up for them.
I'm developing an Android app that might use Wikipedia API to retrieve the content of a given page (from its title). I searched a lot in the web but I don't find useful information about the implementation. I read the MediaWiki documentation and I tried to format my requests in json format (example: request for "mountain" page content but the text isn't clear and I don't know how manage the request from my Android application.
So, my question is: how can I getting (clear) wikipedia page content by passing the title page from my application? And how to save the well format content in a String (that will corresponds with a TextView in a second moment)?
Anyone knows a good tutorial or can help me with some snippets?
Thank you very much indeed guys! :)
action=parse or action=mobileview or action=query&prop=extracts, depending on what exactly do you need. Use the API sandbox to interactively experiment with various requests, it has usage examples and shows how to build requests properly.
I have read the example for Rss Parsing from the ibm site.(http://www.ibm.com/developerworks/opensource/library/x-android/).
In this example,the rss are shown in a listview and then,if you press one announcement you can see it in the web browser of the device.How could i see them in the app,with no use of the device browser?
Thanks a lot
Create a layout with a WebView then load the URL from each "announcement" using WebView.loadUrl.
I'm a little confused but you seem to have answered your own question.
You say you don't want to use the web browser on the device but the example in your question doesn't use the browser. It does exactly what you're asking for.
The idea is that you download the html from the website and then use the parser to break it up into separate "announcements" and store them in list view items in your program.
I have done a bit of this type of thing myself in android. I used jsoup java library, which makes breaking the html into the bits you want to display really easy.
If you want some more help I can give you an example of an app I made that pulls movie times from google.com/movies as an example. here are links to the classes where I did the html download and parse:
ScreenScraper.java
HtmlParser.java
I am looking into developing an App that will convert a website into more readable data for an android app. I am at university and have an online notice board which can be viewed on the web but if possible I would like to transfer this into an app on android to make it more easy to read on mobile devices.
What I thinking is that the app would go to the website where the notice board is held and read in the html code to display each notice in a list adapter view. Each notice is within its own div so I assume I could use that to split each notice up into its own button on the list adapter view. Is this possible and if so how I can go about doing this. I have tried google for an answer but I have not yet found a solution to this problem.
Thanks for your help
It seems overly complicated to me. I wouldn't handle all that using Android. I'd crawl the data on a machine (server) and then I'd convert all needed data to JSON and have the Android (client) fetch the data using a simple JSON parser.
In my opinion that would be the easiest solution if you don't have access to the server the website is hosted on to get it generate a JSON feed for you directly.
EDIT: In answer to your comment Boardy.
Here is the official website of the JSON project in order to get an understanding of what it is. Then if you have access to the webserver providing that page (I assume it is a PHP based site) and want to modify or add the functionality of providing a JSON feed then you should also take a look at the PHP JSON documentation.
To parse JSON on Android check out this SO question and also don't forget to take a look at the official Android documentation on their JSON implementation.
This is very naive... but how do you stream certain bits of information from a website. From what I understand webview launches a web page, but what if I want to only stream a paragraph that was published on a site.
Example: Yahoo! Fantasy Football... Updates on players and the news feed about them.
This is obviously a lot more complicated than my question. I would be interested in a tutorial that could walk me through this. Does this also take programming on the server side to send this out? Thank you in advance.
If the site has an API where their data is available in a easy-to-use-in-an-application format, such as JSON or XML, then you should be able to just get the data over HTTP and then parse it and use it in your application. This might be a reasonably good place to start: http://developer.android.com/reference/org/apache/http/client/HttpClient.html
You could open up a file stream and download the entire html file then parse through it with SAX till you find the data you want and display it. Only problem with this is if they change there website it could break your app.