I was wondering if it was at all possible to attempt the following in an Android app:
I want the user to be able to enter a few keywords, then in the background (while showing a loading animation) have the app search google for the entered keywords, navigate to the first search result, then search the resulting web page for a URL leading to a particular domain, and return this URL to a list in the app?
Is this possible, and could anyone nudge me in the right direction to get this done?
You can use Google search api by Http request methods in backend while showing loading animation, which provides its search results details...
But also look out for restrictions in using this api, i guess in terms of max search requests/day..
Related
Hey i'm trying to get all pins for a specific user from pinterest API in android app
but as i see for now there is no public Api after searching i found this Post which contain an end point for fetching all pins of specific user http://widgets.pinterest.com/v3/pidgets/users/eecolor/pins/
and this works perfectly but it doesn't contain the pin creating date.
Also i have checked the official website which contain a sample response for pins list and the data contain creation date
so how i can do this,is there any extra field should i added to the previous endpoint
Thanks
You can obtain scraping from here:
https://www.pinterest.com/pin/[put-pin-id-here]/
Ex. https://www.pinterest.com/pin/1234565787899/
See the page code:
meta itemprop="datePublished" content="2015-05-19T10:31:33"/
I found that there is no way to get pinterest pins from specific page unless you are the the admin of the page, but in this case you can use this url for using rest Api
"https://api.pinterest.com/v1/me/pins/?access_token=token&fields=id%2Curl%2Cnote%2Ccreated_at%2Cimage&limit=10
and the access token could be generated from here
https://developers.pinterest.com/tools/access_token
Regards
Hello I am beginner to Android development so I want to ask how to create dynamically changeable database (content) in Android?
I'm aware of sqlite shared preferences but how can I interact with them via internet and add new information like news apps? Could Parse help?
This is not a answer, but a comment rather, I don't have the 50 rep required to comment.
It all depends on the sort of functionality you want to achieve. I.e. do you want to be able to push new content to the device using the internet such as push notifications.
OR
Do you want the app to make a http connection to a api or your own news service on startup or on button press for example?
UPDATE
Ok you have decided you want something similar to option 2. I am not going to write code for you but I will point you in the right direction and if you get stuck, post a question.
Please take a look at:-
https://play.google.com/store/apps/details?id=com.rsoftware.news
If you have decided this is what you want or similar, this application uses an API calling infrastructure.
The API they use is called FAROO.
http://www.faroo.com/hp/api/api.html
I suggest reading the documentation, deciding if this is indeed what you want, then sign up and get a API key. Afterall it is free! enjoy coding, enjoy the errors that you will receive and persevere =).
How to make a API call
I suggest when using a API, test the queries through the browser first of all or use something like Runscope for testing their services. So first get their URL which is:-
http://www.faroo.com/api
If we were to go to this url we will get a 401 response code, which means unauthorised. This is because we haven't added our unique API key to the html query. So this url can take parameters. We simply append a ? to the end of the url and supply the parameters that FAROO offers such as:-
q which stands for query (what do you want FAROO to search for?)
start which is the number it should start from
length which is the number of results you want FAROO to return
key which is your unique to make the requests
etc etc...
So an example of a complete url would be:-
http://www.faroo.com/api?q=iphone&start=1&length=10&l=en&src=news&f=json
This url is for demonstration purposes... your own url will have a key=YourAPIKey
Also notice how the parameters are separated by & symbols i.e. q=iphone&start=1 so this part q we know stands for query which is iphone & start=1 & so on.
Hope this helps.
I am trying to write a little Android app for my daughter. The goal is to scan a book's bar code and pass the ISBN number to this website: http://www.arbookfind.com/default.aspx . The result will show if the book is part of the Accelerated Reader program and how many points the book is worth. I am trying to automate the part where the ISBN would need to be entered into the search field.
For simplicity's sake, and because I'm not a programmer, I am using MIT's App Inventor 2. I can now scan and get the ISBN but I will need to know how to format a URL to the website that will allow me to pass the ISBN to it's search page.
Is it possible to send a variable via the URL similar to index.php?myvar=testing&someothervar=somethingelse ? I've tried but perhaps I am not using the correct variable name or format for aspx. Is there an easy way to see what the variable name is in the aspx displayed page in my browser?
EDIT To clarify, I am not trying to scrape data and avoid showing ads from the site I am using to generate the results. I am wanting to pass the ISBN number to the page and have it search and display the resulting page in the phone's browser. I am also fine with a method that would populate the search field and the user would have to hit the search button if that can be accomplished easier.
I would recommend abandoning this route, as it is highly unlikely that the owners of this website will want you passing a query string to their site anyway, but rather they will most likely point you to an Application Programming Interface (API) that they provide, so that your program can connect to this service (free or paid, depending upon the company) and then you can request the book's details by providing the ISBN in the request.
There is no discovery mechanism for an .aspx page like there is for a web service to find out the names of things to pass. Even if you figure out what the name of the query string is that you could pass in for ISBN, you run the risk of the implementation being changed and your "application breaking". While this is also true of web service APIs, since APIs are the route the website providers want you to use, as opposed to screenscraping, then they generally inform their users of breaking changes or newer versions of the API via documentation.
From what I can see that page does not accept URL-variables for their search field the way google.com and other does. The page is generated through some sort of content management system (CMS) and it relies heavily on javascript to make things work. I tried doing a normal search there, and you have two issues you need to wriggle around.
First, the page redirects you to a page where you select if your a student, parent etc. It seems that it relies on some session cookie to remember the setting, but it times out pretty fast.
Second, the form uses javascript to trigger the search, and it appears to be done using AJAX, a method of using javascript to trigger actions on the server and displaying the results, without actually loading the page again. You might be able to get a hold of the javascript code used and re-engineer it for your purposes, and call that using HTTP POST and/or GET from your app, but it is a tricky path, and quite possibly not allowed by the company since you will be loading data from their site, without presenting their advertisements and thus be costing them money.
Let's say there's website X. Website X has a search function that'll return articles/documents/whatever. Whatever it returns will include a link so the user could click on it to go to said article. All of this would be without an API. Would it be possible for an android application to query a search on a random website, get the results and display them in the app, without the user actually seeing the website?
Yes, of course. All you want to do is write the app such that it performs the query to the website on behalf of the user; that way it gets the HTML response. When it gets the HTML page as a response, you parse that and reformat it into something more appropriate for the app.
Look at this SO question if you want more information on HTML parsers in Java: Parse HTML in Android
In my Android application I use the Graph API through the Android SDK.
I keep getting reports that items that were set to be hidden/blocked from the Facebook website (e.g. game posts) are still shown in my application.
The code simply queries "me/home" and process all items returned in the result.
I expected blocked entries to not be present in the result at all.
I also haven't seen any flag indicating whether an item is supposed to be hidden or not.
Looking at the privacy settings at the Facebook website also shows no app-specific settings on that matter.
Is there any way to filter items from the returned json result based to match the way items are shown on web? Is FQL better for this type of usage?
As a side note I also get reports about missing items from the news feed. Using the Graph API Explorer verifies that not all items that are shown on web are also shown in the Graph API result.
Will appreciate any hint.
Bug does not appear when 'Include recent activity stories' is enabled.
A workaround if you want to keep it enabled (and only if you really do because it will break your code otherwise):
add an invalid filter parameter to the query. Example: me/home? filter=garbage