Requirement:
1. jsp page contains a field that having a search button.
2. When I click on search, it should send a Http request and Response page should be of Google Map
3. That Google Map should zoom into particular Location, whatever I have typed in Search field.
Please tell me how to write, because I new to this.
And please tell me some tutorials where I can learn Completely about Java Code which is related to Google Map.
Related
How can i extract email id based on the website that i have got from Place Details using Google maps API.
I want to extract the generic email id from these place details or the website. I have attached a screen shot to show what i have. I am using open Refine.I am able to parse the phone number but can't parse email id's as its not present in these place details but i can see it on the website.
Thank you in advance.
This is the code i am using -
"https://maps.googleapis.com/maps/api/place/details/json?placeid=" + cells['PlaceID'].value + "&key=AIzaSyCSp-f-_FWHw8jfNFF9yd7mgUxaX-DZo8g"
According to the google maps places API this is not something that can be returned from the API. I believe that Google does not want its API to be used as a source for spamming companies. Based on that, I can't think of any legal option that would give you this email.
The only solution that I can think of would be to get the URL attribute from google maps API result and from then scrape the page and hope that there is a way to find the email address in the HTML code, but :
I don't think that google would present it in a easily scrappable way;
I believe it would go against terms of use of Google.
So to summarize I don't think there is an easy and legal solution to your question.
Let me just start by saying that this is a soft question.
I am rather new to application development, and thus why I'm asking a question without presenting you with any actual code. I know the basics of Java coding, and I was wondering if anyone could enlighten me on the following topic:
Say I have an external website, Craigslist, or some other site that allows me to search through products/services/results manually by typing a query into a searchbox somewhere on the page. The trouble is, that there is no API for this site for me to use.
However I do know that http://sfbay.craigslist.org/search/sss?query=QUERYHERE&sort=rel points me to a list of results, where QUERYHERE is replaced by what I'm looking for.
What I'm wondering here is: is it possible to store these results in an Array (or List or some form of Collection) in Java?
Is there perhaps some library or external tool that can allow me to specify a query to search for, have it paste it in to a search-link, perform the search, and fill an Array with the results?
Or is what I am describing impossible without an API?
This depends, if the query website accepts returning the result as XML or JSON (usually with a .xml or .json at the end of url) you can parse it easily with DOM for XML on Java or download and use the JSONLibrary to parse a JSON.
Otherwise you will receive a HTML that is the page that a user would see in a browser, then you can try parse it as a XML but you will have a lot of work to map all fields in the HTML to get the list as you want.
I've written a java applet which sends longitudes and latitudes trough POST requests. I need to write a server page which will receive this data and dynamically shows a google map with the received points on it. (php/etc...)
I don't know how to start with this, because I really don't know what to do first.
https://developers.google.com/maps/documentation/imageapis/ has all the information you need.
So you simply need to get a server page to recieve your POST data, parse the longitude and latitude and then get the image result from the URL below (look inside the src attribute).
Should be fairly obvious what all the parameters are, zoom level on google maps and the size of the map in pixels. Alternatively if you just want this map displaying on a webbrowser you just output the img tag shown below
<img src="http://maps.googleapis.com/maps/api/staticmap?center=-15.800513,-47.91378&zoom=11&size=200x200&sensor=false">
EDIT:
The URL will dynamically generate the map each time you send a POST request. If you need the data to continuously change then maybe using POST requests isnt the best way to do it. POST is best used for data which you want to send off to a server then do something with (generate a single map etc).
As an example...
The user wants a map of where a particular street is that they have clicked on
>
Send POST request
>
Get the map using the Google Maps URL and send this back/output to a webpage.
As an alternative you might want to look at the various Maps APIs on the site. A better link for this would be https://developers.google.com/maps/
It's not quite clear what you are aiming to do so providing an example usage would help with a better answer.
We have a very specific need. We want to create a generic (Java based) registration system for Event organizers. So every Event organizer can define a custom form on our application, and then we collect the data from users for that particular event.
Now the input fields can change from Event to Event, so I was thinking to use some out-of-box cloud solution. One obvious thing came to my mind was to use Google Forms. So for every event, if we can programmatically create a Google Form and get following 2 things:
1) Embed link for that form
2) Access to corresponding data keeping Google Spreadsheet
We can use the embed link to show the Registration form to users on Event page. And we can access the Google Spreadsheet to access the data that Users have been filling in the Registration form.
But when I searched for it, I couldn't get a clear way to achieve this. There is some Google Documents List API, through which you can create Google documents programmatically, but I couldn't figure out, how to meet our needs through this API.
It would be of great help, if somebody can guide us in this regard. Or suggest us any alternate cloud solution.
UPDATE::
Looks like Google doesn't provides an API at all for Forms linked with Spreadsheets. http://goo.gl/ia8rk If we are lucky, they might include in their future releases.
So any other cloud based API that can be handy for this problem??
If I understand correctly, you have a Google sheet and you want a way to automatically generate a form. That generated form should link its responses back to that spreadsheet. Is that correct?
I don't know a way to do that with Java (if there is an available API for that, I don't think so) but that can be easily accomplished with Google Scripts. This was built in the script editor of a Google Spreadsheet.
Here is an example:
function onOpen() {
// read the docs to add to the toolbar
}
function getColumnHeaders() {
// this grabs the headers of your sheet
var headers = SpreadsheetApp
.getActiveSheet()
.getRange(1, 1, 1, SpreadsheetApp.getActiveSheet().getLastColumn())
.getValues()[0];
// this will appear in your root directory
var newForm = FormApp.create('NEW FORM NAME');
newForm.setDestination(FormApp.DestinationType.SPREADSHEET, SpreadsheetApp.getActiveSpreadsheet().getId());
headers.forEach(function(each) {
newForm.addTextItem().setTitle(each);
});
}
The documentation can be found here: https://developers.google.com/apps-script/reference/forms/
I daily visit this link to find my lectures at school. Every time I have to scroll down the list to find my own class, and then post it so I can view the result. Is there any way i could make a direct link to the preferred content? I'm looking to create a simple webview app in Android showing individual form categories.
EDIT : Really any method for converting the aspx info into another format would do the trick. Prefferably a direc link to each form item. But if I can convert every single item to a .xml file or anything else I could work with it. But I have to make it automated.
You can capture the outgoing request and write a simple application to POST the data back to the page. The WebClient class is useful for this.
Looking at the request in Chrome's developer tools, I see that the form posts back to itself and then redirects to the result page. Presumably, you should POST the form data to the initial page, which will then cause it to perform the redirect.
The form contains a large amount of ViewState data which may or may not need to be included in the request to make it work.
A completely different approach would be to find a browser extension, such as a macro recorder, which emulate your actions. This plugin (haven't tried it myself) appears to do exactly that.