Google+ Pages API - publishing a post with custom thumbnail of url attachment - google-api

We are using the G+ Pages API to post into a G+ Page. When creating a post, we enable link attachment with customization of the link thumbnail image.
Sometimes, the API ignores the image url with give it and selects another image (without returning any error message). I'm trying to understand why but I couldn't find any documentation that can provide an explanation.
Here is an example:
This is the url we are attaching to the post: https://business.yell.com/knowledge/attract-right-social-media-audience-increase-followers/
This is the body of the request:
{
"access":{
"items":[
{
"type":"public"
}
]
},
"object":{
"attachments":[
{
"image":{
"url":"https:\/\/business.yell.com\/knowledge\/wp-content\/uploads\/2015\/01\/how-to-attract-the-right-social-media-audience-and-increase-followers.png"
},
"objectType":"article",
"url":"https:\/\/business.yell.com\/knowledge\/attract-right-social-media-audience-increase-followers\/"
}
],
"originalContent":"content text"
}
}
The image url is from a meta tag (og:image) in the article source, but the API ignores the url and uses a different image from the page.
Any idea what am I doing wrong?
Thanks!

OK, so I used facebook open graph object debugger on the url (https://developers.facebook.com/tools/debug/) and found that
og:image was not defined, could not be downloaded or was not big enough. Please define a chosen image using the og:image metatag, and use an image that's at least 200x200px and is accessible from Facebook. Image 'https://business.yell.com/knowledge/wp-content/uploads/2014/12/Anna-Bravington_avatar_1418999410.jpg' will be used instead.
If I send a different thumbnail image to FB it uses it but G+ for some reason (which I don't know what it is yet) ignores it.

Based on GooglePage api docs, there are 2 ways to posting an article with an image:
Article with an image from Google+ photos : Upload your image to Google+ photos. The image can be any public image from Google+ photos belonging to your Google+ Pages account — the image does not have to be from your target article page. You specify your post (Article) with the image's url using the direct URL returned by the Media.insert method. (Do not specify a private image as its rendering is undefined.)
Create an activity with a URL in the attachments array, and POST it with the preview argument set to true. (Example: $plus->activities->insert($remote_id , $activityObj, array("preview"=>true) ) ). This POST will return a preview rendering of your activity, with a list of thumbnail images for you to select from.
This is mean that the object.attachments.image.url have to be either a google+ photo url or a thumbnail image returned from object.attachments.previewThumbnails

Related

How does google Translate works as a proxy?

When you put a link inside the text field in Google Translate, it gives you back the same URL which you can click and then it loads the page in what still seems the inside of Google translate.
How does it work?
When you submit a URL to Google Translate, it displays the same URL as a hyperlink in the translation box, however the actual link is some JavaScript:
javascript:ctr._submitUrl(true);
This JavaScript performs the redirect to the proxied Google Translate version of the page: https://translate.google.com/translate?

Reference ParseFiles stored in Parse via URL

I'm working on an iOS and Android that app sends an email that contains 2 images. It doesn't attach the images to the email, rather it links to them via URL using the src property of the img tag in the email's HTML content. I would like to know if I can use Parse to store those images and reference the URLs for the ParseFiles in the email.
My questions are:
Do you just add the image to the database in a new class, or is there a separate location for public assets? (If not I can get the URL by clicking on the file which opens in a new tab in the browser.)
Is that URL guaranteed to never change so long as the image never changes? (If not I'd need to use a query to fetch the images from parse then get its url.)
Does visiting that URL for example in a web browser count as a request Parse keeps track for pricing purposes?
Piece of the email that will render the image:
<img width="186px" border="0" style="display: block; width: 186px;" src=\"http://url_to_photo_needs_to_go_here.png" alt=\"logo\">
You sure can. Every PFFile object includes a url property that you can use to directly access the file.
Simply grab this url property and insert it into the html for your email.
For reference: PFFile Class Reference for iOS (available for other SDK flavors too)

Embed feed ObjectProperties: image is not visible in Yammer site feed page

I am using objectProperties for image to be visible in yammer feed of page. But it is not showing in yammer site feed page. Image url I am specifiying from SharePoint site collection image library(https://XX.sharepoint.com/SiteCollectionImages/PR.gif). However it is working fine if I give some internet accessed image (e.g. www.google.com/images/123.gif).
Also If I click on “goto page” link in that feed there same image is visible. Please note I am already logged in to SharePoint site with another tab.
objectProperties: {
type: "page",
title: pageTitle,
url: pageUrl,
image: "https://XX.sharepoint.com/SiteCollectionImages/PR.gif"
}
#Yammer-team: I think embed.ly is interrupting in home page feed. can you please check and confirm. Thanks.
I got the answer from Yammer documentation that currently yammer is supporting image url only accessible from publicly accessible content. https://developer.yammer.com/opengraph/#og-schema
one more comment from Myo Thein that - "We use embed.ly and hence it needs to be available on the internet."

Picasa API returns different XML when requested with Ajax

I'm creating a Phonegap app for a client. The client wants their Google+ gallery incorporated in the app. I use the Picasa API to get a list of albums. So url I use is:
https://picasaweb.google.com/data/feed/api/user/101422180005529258056
If you you put this into a browser and view the XML in an XML viewer, you will see there are 7 "entry" tags. Each of these describes an album.
However, if I hit the link through Ajax in the Phonegap app, I only get back just 2 "entry" tags.
When I do it through php, I also only get back 2 "entry" tags:
$xml = file_get_contents('https://picasaweb.google.com/data/feed/api/user/101422180005529258056');
file_put_contents('/var/www/my_logs/xml.log', $xml);
Why does entering the link directly in a browser give different results to using file_get_contents or Ajax?

How to suppress &ref=nf query string from Facebook wall posting image link?

I am writing an iPhone app that includes the ability to publish a link to a user's wall on Facebook using the latest Facebook supplied iOS SDK. To the dialog method I give a name, caption, description, link, and picture in a params dictionary. The method call successfully opens a dialog for the user in the app (after authenticating), where they can add a message and tap Publish. So far, so good.
Looking at the result on the user's wall, both the title of the post (the "name" in the dictionary mentioned above) and the picture associated with the post are clickable links with the url I specified in the method call (via "link"), as expected. Well almost.
Now the problem: while the link on the post title is exactly as specified, the link on the image has the additional, unwanted query string ?ref=nf appended. I want to know how to suppress this, as it breaks my goo.gl shortened link.
I don't think this is iOS specific. It happens on this Facebook developer Feed Dialog page as well. Go down to the section Example, and click where it says Click here to try the url yourself, you’ll get a Post To Your Wall page. If you click Publish and then go to your own wall, you will see that the link for the image and the link for the title are different, with the image link including the extra query string. Which is what I want to suppress.
Interestingly, before you publish from the above page, you can hover over the image and the title, and the reverse it true. The title link has the extra query string but the image link is clean. Bizarre. I cannot see if that is also true in my iOS app, since I have no way to "hover" on the iPhone.
Two other data points
I see this in posts from at least some other apps; the fully expanded links being used there are apparently oblivious to the extra query string information
I don't see this if I post directly from my Facebook news feed page from the Facebook web site
Anyone know how to eliminate/suppress this extra query string from the image link when posting programmatically?
Looking at this post in the facebook forums, it appears you would have to strip it manually yourself. I.e. send it to a shortener that you control and doesn't care about the query string.
They are going to add that query string always. So if you want to handle it gracefully, you need to control where the link goes to initially, or find a url shortener that ignores this parameter.
This is solution:
Remove parameter from URL viac .htaccess

Resources