Suggest list in google maps search input - search

We need to create search input field like it is on _http://maps.google.com
The key functionality is suggest list with appropriate results. We
have not found this feature in API.
Analyzing maps.google.com we see that suggest list is received
from get request to this url
https://maps-api-ssl.google.com/maps/suggest?q=%D0%BC%D0%BE%D1%81&cp=...
There are many parameters, including data from search field. This get
request returns our suggest list.
Is there a possibility to use this url in our needs with our data. Or
how can we make it in some other way.
Similar to our needs: _http://cdn.michaelhart.me/mh/instant/maps/

check this out:
http://tech.cibul.net/geocode-with-google-maps-api-v3/

Theoretically you shouldn't use maps-api-ssl.google.com/maps/suggest as it might not be legal. I found this quote from google employee:
'Endpoints like this that are used by Google Maps but not documented as
part of the Maps API should be considered private interfaces.
Consequently use of those end points is a breach of the Terms of
Service. In addition any existing API credentials you may have are
completely unrelated to these end points because they are not served
by API infrastructure'

Related

Search a specific search of a journal article based on the user type

I have this requirement:
We have a journalarticle and we wish to have sections which have content for internal and external users for the application.
We are able to hide the content from rendering by implementing custom template on web content display and using a simple custom-field for a user which helps us to classify it.
Having said that when we search something as an external user, the search portlet is able to fetch an article where the search text is a part of internal user content, and due to the above mentioned template the content is not visible.
In short, from the user's perspective the resultant article does not match the searched term.
I wish to seek some pointer to check whether there is a mechanism to ensure that when an external user searches something then we only search the dynamic-element of the doc which matches the user type?
We have thousands of such articles and create multiple copy of the same article does not seems viable solution.. so any pointers would be a great help.
Liferay version : 6.2 GA4 CE
Thanks!
AJ
First of all: Not finding a search term in a document can be a sign of good working synonym resolution in the search engine. It's questionable if this behaviour is always wrong or only in this particular case. Remember google bombs?
That being said, I believe that this architecture of half-visible documents is flawed from the beginning. Ideally I'd suggest to change it, for example by splitting the information to two articles, so that you can use the standard permissions to resolve. If you link both, you can determine how/which article or template to use. It's not an ideal solution, but might be a workaround.
Another workaround might be to change Liferay's indexer component and index two different versions of the article, with two different permissions. Of course, you'll have to change the search side as well, so that you'll find each article at most once, even if it's now twice in the search engine.
Again - not ideal, but might be the quickest fix that you can get right now without changing the underlying architecture. However, to change the underlying architecture is my actual recommendation.

Instagram - Obtaining data in realtime

I am trying to get the recent post from a particular location. using this url.
https://api.instagram.com/v1/media/search?lat=34.0500&lng=-118.2500&distance=50&MAX_ID=max_id&access_token=XXXX
So when I use this URL for the first time, I get 20 results. I obtain the max ID from the list of 20 results and modify my url .
But when I use the modified URL, I obtain the same result as the first one.
How do I go about solving this?
Contrary to what I thought, the media search endpoint doesn't return a pagination object. Sorry. It also doesn't support the min_id/max_id parameters, which is why you are having problems..
If you want to get different data you are going to have to use the time based request parameter MIN_TIMESTAMP. However it looks like that parameter doesn't work for that endpoint either (though the documentation says it is supported). Indeed, a quick search on the internet reveals it might be a long standing bug with the api.

Liferay Structure Predefined Value

Which table in Liferay stores the predefined values given for a structure.
Also is there a facility in Liferay to populate these values dynamically using webservices?
The API used to be JournalStructureService, however, as the documentation states, this has been replaced with the Dynamic Data Display API, which, for example, you can find under DDMStructureService in version 6.2.
This gives you a hint where to find the underlying data, however, you don't want to manually write to the database. You do want to use the API to change values. Trust me. Consider the database to be an implementation detail and leave it alone - if nothing else to make your next upgrade experience easier. You should never change any values in the database manually without knowing exactly what you're doing. And, trust me, the keyword here is "exactly", and you'll fail to know all the possible side effects. Don't touch it.
As said #Olaf, depends on Liferay version you will need to use the JournalStructureService or the DDMStructureService. So, if you want to use the Liferay Service by web api you have two options the Axis api where you can obtain WSDL (domain:port/api/axis) or you can use the Json api (domain:port/api/axis). In many cases you are going to need a token to use this services.

how to access google define feature in a batch

Suppose I have a huge set of noisy phrases. For each one of them, I want to check if it is defined by some resources by using the google define feature. Once I type "define my_phrase" to the google search box, if the retrieved results contain the definition panel (e.g. https://www.google.com/#q=define+home+cooking), I put it into my phrase pool.
I'm wondering is this possible to do this task in a batch so that I don't have to type each of the phrase manually one by one? It would be great if this could be achieved from a unix terminal but windows is also welcome!
I heard of google-app-engine but I only have a rough idea and not sure if it could help.
Thanks!
as starting point, you may try and play with the Google Custom search following API reference - Xml results
https://developers.google.com/custom-search/docs/xml_results?hl=en&csw=1#XML_Results
Be aware of:
google TOS for this service
quantity courtesy limit

Can I associate custom metadata with an ALAsset?

I'm building an iPhone app that, among other things, allows the user to take and store photographs associated with locations. I am currently using the ALAssetLibrary to allow the photographs to be stored in Photos and be accessible outside the app (on a computer for instance via the built-in mechanisms). There is not a lot of technical content out there for working with the ALAssetLibrary but from what there is I have managed to cobble together a working version of this. I have had to resort to storing a dictionary of photo URLS in my app and manually detecting if the photo still exists when displaying lists of them because there does not seem to be a way to add custom metadata to an ALAsset.
What I would really like to do is add two custom metadata fields to each asset to provide it with a title and a custom id value that I can use to filter on when enumerating the asset library.
As a secondary task, I'd like the user to be able to update the title metadata.
Can it be done? At this point, I really don't think it can because the API really doesn't seem to provide the necessary methods to get/set custom metadata. I'm hoping against all odds that there is some other aspect to the AssetLibrary framework that I have not yet discovered.
At a minimum, if someone can authoritatively say "NO" then at least others might find this breadcrumb on their own trail of hope and change tack more quickly!
And, having 0 reputation I can't tag it with AssetLibrary :( wow, this day is just going downhill. FML
I've been looking over the documentation and I dont think it is possible to tack on additional fields to the ALAsset object, well you can create your own object or extend theirs but that wont help you when your pulling back assets because you'll need to init yours and populate it then.
Look I know this falls short of a really good answer but I had to try.
The ALAsset class documentation describes a property - customMetadata. This is documented to be an NSDictionary of whatever custom tags you want. Currently, however, it is not implemented in the class (I've raised a bug on Apple's developer site to bring the issue up).

Resources