I've been trying to integrate a Google schema (LodgingReservation schema) in my company's hotel booking confirmation e-mails, in order to make corresponding hotel reservation cards appear in Google Now/Google Search, as specified in the following Google documentation :
https://developers.google.com/gmail/markup/reference/hotel-reservation
I've sent a test e-mail containing the JSON markup multiple times to my Gmail account, opened the e-mail, then refreshed my Google Now app's feed multiple times, but no Reservation Card showing there.
I do get some other types of cards, such as local weather info, event reminders from my calendar, etc. I checked the settings on my Google account and Android phone multiple times, tried to use different accounts and phones from my colleagues, but it won't show ANYWHERE.
HOWEVER :
Viewing the source from the e-mail, I was able to confirm that the expected markup was there, and even managed to validate it using the following Google tool : https://www.google.com/webmasters/markup-tester/
Using my Google account, I'm able to see that my Google Card history contains a "travel" type card, supposedly received today, and that appears on every phone/Google account I've tested, a few seconds after the booking confirmation e-mail was sent
Based on those informations, I assume the card is recognized somehow by my account, but I don't get why it wouldn't show in the gNow feed ...
Would someone have an idea about that ?
Here is the markup I've sent in the e-mail :
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "LodgingReservation",
"reservationNumber": "872914",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Max Mustermann"
},
"reservationFor": {
"#type": "LodgingBusiness",
"name": "Verkaufshotel Blaue Linde",
"address": {
"#type": "PostalAddress",
"streetAddress": "Industriestraße 27",
"addressLocality": "Offenburg",
"addressRegion": "Ortenau",
"postalCode": "77656",
"addressCountry": "Deutschland"
},
"telephone": "+49 781 310 55 0"
},
"checkinDate": "2015-11-20T11:00:00-08:00",
"checkoutDate": "2015-11-23T11:00:00-08:00"
}
</script>
#Joffrey Quillet I've tested your markup and was able to generate a Now card, however, I did change the checkinDate and checkoutDate during my test:
"checkinDate": "2015-11-23T13:30:00-08:00",
"checkoutDate": "2015-11-24T11:00:00-08:00"
I have a feeling you're located in a area that doesn't support hotel reservation cards. Per this documentation, "Even if you can turn on Google Now in your country, you might not see every type of Now card."
Here is my result using your markup example:
Related
I am currently developing a website for a client. It consists of users being able to upload pictures to be shown in a gallery on the site.
The problem we have is that when a user uploads an image it would obviously need to be verified to make sure it is safe for the website (no pornographic or explicit pictures). However my client would not like to manually have to accept every image that is being uploaded as this would be time consuming and the users' images would not instantly be online.
I am writing my code in PHP. If needs be I could change to ASP.net or C#. Is there any way that this can be done?
2019 Update
A lot has changed since this original answer way back in 2013, the main thing being machine learning. There are now a number of libraries and API's available for programmatically detecting adult content:
Google Cloud Vision API, which uses the same models Google uses for safe search.
NSFWJS uses TensorFlow.js claims to achieve ~90% accuracy and is open source under MIT license.
Yahoo has a solution called Open NSFW under the BSD 2 clause license.
2013 Answer
There is a JavaScript library called nude.js which is for this, although I have never used it. Here is a demo of it in use.
There is also PORNsweeper.
Another option is to "outsource" the moderation work using something like Amazon Mechanical Turk, which is a crowdsourced platform which "enables computer programs to co-ordinate the use of human intelligence to perform tasks which computers are unable to do". So you would basically pay a small amount per moderation item and have an outsourced actual human to moderate the content for you.
The only other solution I can think of is to make the images user moderated, where users can flag inappropriate posts/images for moderation, and if nobody wants to manually moderate them they can simply be removed after a certain number of flags.
Here are a few other interesting links on the topic:
http://thomas.deselaers.de/publications/papers/deselaers_icpr08_porn.pdf
http://www.naun.org/multimedia/NAUN/computers/20-462.pdf
What is the best way to programmatically detect porn images?
The example below does not give you 100% accurate results but it should help you a least a bit and works out of the box.
<?php
$url = 'http://server.com/image.png';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/detect_nudity.php?url=' . $url));
if (#$data->success !== 1)
{
die('Failed');
}
echo 'Contains nudity? ' . $data->nudity . '<br>';
echo 'Nudity percentage: ' . $data->nudity_percentage . '<br>';
If you are looking for an API-based solution, you may want to check out Sightengine.com
It's an automated solution to detect things like adult content, violence, celebrities etc in images and videos.
Here is an example in PHP, using the SDK:
<?php
$client = new SightengineClient('YourApplicationID', 'YourAPIKey');
$output = $client>check('nudity')>image('https://sightengine.com/assets/img/examples/example2.jpg');
The output will then return the classification:
{
"status": "success",
"request": {
"id": "req_VjyxevVQYXQZ1HMbnwtn",
"timestamp": 1471762434.0244,
"operations": 1
},
"nudity": {
"raw": 0.000757,
"partial": 0.000763,
"safe": 0.999243
},
"media": {
"id": "med_KWmB2GQZ29N4MVpVdq5K",
"uri": "https://sightengine.com/assets/img/examples/example2.jpg"
}
}
Have a look at the documentation for more details: https://sightengine.com/docs/#nudity-detection
(disclaimer: I work there)
There is a free API that detects adult content (porn, nudity, NSFW).
https://market.mashape.com/purelabs/sensitive-image-detection
We've using it on our production environment and I would say it works pretty good so far. There are some false detections though, it seems they prefer to mark the image as unsafe if they are unsure.
It all depends on the level of accuracy you are looking for, simple skin tone detection (like nude.js) will prob get you 60-80% accuracy on a generous sample set, for anything more accurate than that, let's say 90-95%, you are going to need some specialized computer vision system with an evolving model that is revised over time. For the latter you might want to check out http://clarifai.com or https://scanii.com (which I work on)
Microsoft Azure has a very cool API called Computer Vision, which you can use for free (either through the UI or programmatically) and has tons of documentation, including for PHP.
It has some amazingly accurate (and sometimes humorous) results.
Outside of detecting adult and "racy" material, it will read text, guess your age, identify primary colours, etc etc.
You can try it out at azure.microsoft.com.
Sample output from a "racy" image:
FEATURE NAME: VALUE:
Description { "tags": [ "person", "man", "young", "woman", "holding",
"surfing", "board", "hair", "laying", "boy", "standing",
"water", "cutting", "white", "beach", "people", "bed" ],
"captions": [ { "text": "a man and a woman taking a selfie",
"confidence": 0.133149087 } ] }
Tags [ { "name": "person", "confidence": 0.9997446 },
{ "name": "man", "confidence": 0.9587285 },
{ "name": "wall", "confidence": 0.9546831 },
{ "name": "swimsuit", "confidence": 0.499717563 } ]
Image format "Jpeg"
Image dimensions 1328 x 2000
Clip art type 0
Line drawing type 0
Black and white false
Adult content true
Adult score 0.9845981
Racy true
Racy score 0.964191854
Categories [ { "name": "people_baby", "score": 0.4921875 } ]
Faces [ { "age": 37, "gender": "Female",
"faceRectangle": { "top": 317, "left": 1554,
"width": 232, "height": 232 } } ]
Dominant color background "Brown"
Dominant color foreground "Black"
Accent Color #0D8CBE
We are using the nearby search feature as described here (https://developers.google.com/places/web-service/search) to perform auto check-in in Android as well as iOS mobile apps.
However, when we call the web API, many of the nearby locations do not show up in our results. At the same time, I do receive notifications from the Google Maps App on my Android phone, asking if i am at the venue meaning the google maps app correctly detects my location.
As an example I was dining at Nando's located at:
https://www.google.com/maps/place/Nando's+PERi-PERi/#41.8854864,-87.6238967,19.85z/data=!4m5!3m4!1s0x0:0x714d54c7334f4af6!8m2!3d41.885548!4d-87.624252
But when I called the nearby search, Nando's did not show up in my list of nearby places. I checked and my gps coordinates were correct and google maps was able to detect my location and check me in.
Anybody know why this happens? Is there a workaround or a solution for this problem?
You didn't post the Places API query, so it is difficult to say what is wrong in your application.
I tried it myself and it worked for me as expected. Let suppose I have a GPS coordinate 41.885565,-87.62425, this is a position more or less of the Nando's you mentioned in the description (have a look at Geocoder tool):
https://google-developers.appspot.com/maps/documentation/utils/geocoder/#q%3D41.885565%252C-87.62425
Now I can create a nearby search request for location 41.885565,-87.62425 with results rank by distance, so the nearest place will be the first in response and also we have to apply a type parameter in the request according to the documentation:
If rankby=distance (described under Optional parameters below) is specified, then one or more of keyword, name, or type is required.
The resulting request is
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=41.885565%2C-87.62425&rankby=distance&type=restaurant&key=MY_API_KEY
With this request I get Nando's (place ID ChIJ9xIeWq8sDogR9kpPM8dUTXE) as the first item in the response
"results":[
{
"geometry":{
"location":{
"lat":41.8855475,"lng":-87.6242518
},
"viewport":{
"northeast":{
"lat":41.8870082302915,"lng":-87.62290226970849
},
"southwest":{
"lat":41.8843102697085,"lng":-87.6256002302915
}
}
},
"icon":"https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id":"a29ff7d92a100fd6f5a8c0e34dff84806838f2d9",
"name":"Nando's PERi-PERi",
"opening_hours":{
"open_now":false,
"weekday_text":[
]
},
"photos":[
{
"height":3036,
"html_attributions":[
"Marco Laure"
],
"photo_reference":"CmRaAAAAwbEPFsgrrjKVrplwBAAmKhKe5CkFX9wn_x1ZF9d6K8rRdT8tRUiW23-qEGLwbuf1wePdUkSrSN21a8r696kXGv6KYG42mI7RaDf2n80iLJlDVtEXys1KK4Hn9_nebsLwEhC6CQemKH3oHLe52i5m-JzOGhQoYbUFTntC5IuEzvASfjPvhDgr_g",
"width":4048
}
],
"place_id":"ChIJ9xIeWq8sDogR9kpPM8dUTXE",
"price_level":1,
"rating":4.2,
"reference":"CmRRAAAARrKCjwMLRvvXncBVw9pCf8RNq1GpfjDrHD8Jh_du12zBJxJ_eaGidizxAny31qn24BgZDpab346A3_QYbgaUMMZOnratR9XBNkQNS1a-DCPSFggzNjsUoOl_QQkhQU-DEhDExmV2z_pyXAkAoxRzIAVQGhT5kjoH3myVM7-vraAlw0EG512ykw",
"scope":"GOOGLE",
"types":[
"restaurant","food","point_of_interest","establishment"
],
"vicinity":"117 East Lake Street, Chicago"
},
I hope this helps!
I am trying to track few events of enhanced ecommerce which is to be reported in Google Analytics. I am following this link. But I am not able to see purchase data in Google analytics. My dataLayer push code is something like below:
dataLayer.push("ecommerce",
DataLayer.mapOf(
"purchase", DataLayer.mapOf(
"actionField", DataLayer.mapOf(
"id", "T12345",
"revenue", "35.43",
"coupon", "SUMMER_SALE"),
"products", DataLayer.listOf(
DataLayer.mapOf(
"name", "Triblend Android T-Shirt",
"id", "12345",
"price", "15",
"category", "Apparel",
"quantity", 1)))));
And and Tag creation is something like below:
Tag type : Universal Analytics
Track type : Screen View (App View)
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Firing Rule : {{event}} equals screen_opened and PageTitle equals Payment
Here after I push this purchase tags, I send screen_opened event with PageTitle value as Payment. And in the logs it shows that this appView event is tracked and hit is sent to AnalyticsService.
But I am not seeing any purchase report in the Analytics dashboard (I waited 2-3 days). I am seeing all other reports like screen_opened and other enhanced ecommerce events like add to cart. Is there something which I am missing in my implementation?
I am using Cordova plugin to login with Google Plus on Android not receiving User data except email.
The success callback (second argument) only provinding email object.
function (obj) {
alert(JSON.stringify(obj)); // Only show email
},
It is not provideing following contents:-
obj.userId
obj.displayName
obj.imageUrl
obj.idToken
obj.oauthToken
obj.gender
obj.givenName
obj.middleName
obj.familyName
obj.birthday
obj.ageRangeMin
obj.ageRangeMax
I have read many articles but couldn't find out how it will show full detail.
I have also tried with scopes parameter.
{
'scopes': 'profile, email',
'offline': true,
},
I am integrating Instagram in my android app. I am able to get authetication and token from Instagram API. Now what I am looking for is userinfo. As soon as user is authenticated I want his userinfo like username,name etc. Any idea how to get it ? I tried several ways but didnt able to achieve it.
I tried this example https://github.com/poller/instagram-demo-for-android
Get basic information about a user. To get information about the owner of the access token, you can use self instead of the user-id.
Link for Documentation is :
https://instagram.com/developer/endpoints/users/
Use this API :
https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN
Response contains information about that particular user requested by passing ID :
{
"data": {
"id": "1574083",
"username": "snoopdogg",
"full_name": "Snoop Dogg",
"profile_picture": "url of picture",
"bio": "This is my bio",
"website": "website of that user",
"counts": {
"media": 1320,
"follows": 420,
"followed_by": 3410
}
}
Simply pass your access token to this url. And you will get the logged user information of the Instagram.
[https://api.instagram.com/v1/users/self/?access_token=YOUR-ACCESS-TOKEN]
this will return the user information like the above #Heena Arora mentioned.
And also she mentioned about retrieving the user information for the particular user by id.