Changing metadata for Ember.js apps - facebook

I have problems with linking my website (built with Ember.js) to Facebook (for each page - there's the same title, description, image etc - of course). I'm wondering if there is any solution to fight with this, without bringing that metadata (for each page) directly from the backend? I would like to change title, description, image etc for each page.
You can actually change title, description and other meta tags (by extending routes in Ember.js), but this is done only on client side and won't actually change the data so that Facebook for example can read the data and get the proper results.
Also, I cannot just put meta tags in since that it's not valid.
So, is there any other solution to properly use "open graph" metadata inside Ember.js app?
Concrete example:
http://www.skripinc.com/ -> this is the page about which I'm talking about. When I try to share it on Facebook, it will always pull the same Title, Description and image, which is set under metadata inside . I want to be able to have different metadata for each page, without bringing the data from the backend (with PHP or whatever).

Related

Link query strings get cut off

I'm not aware of link designing strategies, so I am not sure why my link gets chopped off when someone clicks on from sources like Facebook etc.
I have a 'share feature' on my platform, which lets a user create a link to their listing and share it with people.
The link I generate for the listing in my backend has parameters, which reads the listing id and the type and displays content over HTML
Here's a sample link for a listing
https://www.fayvors.com/Share.html?hash=5eccccaa-7b8d-42bd-af8c-08d50da0c867?type=lessons/
However, when I share the link on facebook and click it, the browser redirects to a link that's cut off
https://www.fayvors.com/Share.html?hash=5eccccaa-7b8d-42bd-af8c-08d50da0c867%3Ftype%3Dlessons
I'm not aware of link designing principles, so I'm a bit lost here!
Thanks!
Your URL contains “special characters” (like a second question mark inside the query string), but you neglected to apply proper URL encoding when putting this URL as a parameter value into another URL:
javascript:window.location.replace('https://www.facebook.com/sharer/sharer.php?u='+window.location)
Use encodeURIComponent on the value you are concatenating to the sharer URL here.

What are the extra parameters in Facebook's static link?

Note: I realise it's a bit unconstructive and I'm not sure whether this is the best place to ask. Please advise me of improvements.
You know you can get the link to a facebook photo (or video) by right clicking and selecting 'view image'. The result is a link like this:
https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/v/t34.0-12/10933156_10203060010133603_822853448_n.jpg?oh=dba759bccf50f4ae560b537fa9c00220&oe=54B175C2&__gda__=1420909750_63a4972d4a589cd466a895e276fc47eb
And it's a public link, that everyone can access.
However, I kept this link in my open tabs for a few days, and later on it didn't work anymore. I went back to the photo on facebook, and did 'view image' again. I got the following link: https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/v/t34.0-12/10933156_10203060010133603_822853448_n.jpg?oh=70ebf67dc3467b8005e2127c4c2a176e&oe=54B8B602&__gda__=1421384950_1bad935cd7546335702cca5849a374fe
Note the two links are identical up to the .jpg part, but they differ in the parameters.
Is there any way to find out what those parameters are and to generate them? Namely, if by having the link up to .jpg I can use some logic to get the right parameters to view the content (like profile id, date, encoding etc)
To get an updated link of a image, you'll need to get it via Graph API using the object id.
Example: https://graph.facebook.com/<object_id>?fields=images&access_token=<access_token>
This call will return an JSON object with all the sizes of images and updated links:
{
"height": 1365,
"source": "https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xpa1/t31.0-8/10904088_10152667653291915_7973131445285931474_o.jpg",
"width": 2048
}
You can get the object id via Graph API or the link of the image on the web interface. Example of url: https://www.facebook.com/photo.php?fbid=10152667653291915 - The fbid parameter is the object id you need.
No. Those are CDN links and they expire. And it is by design they expire so no you can't generate the rest of the url

multiple facebutton button like with different values

Is it possible to have multiple og:title(etc) in a page?
I have 4 different products on same page (url: site/#theblock)
I want my users to share the product with the correct link on their FB.
I tried jquery but its not working.
Im using a wordpress cms.
Any idea how to do it?
Thanks
You need to use some server side technology to dynamically change the og tags based on query string parameters. Hash tags will not work since they are only used by the browser and are not sent to the server.
The reason to set the og tags server side is because Facebook's scraper does not run JavaScript and therefore your server needs to make the correct tags upon serving the page.

How to define what will be inserted in share message?

I have an app with blog records per each user. I have add share button to my app, to give ability to post interesting blog records to users time line or to send to other user. But in default it takes image and text for share as it wants and not always correctly. So I find out that it can be dirven by meta tags (using for example "image" property to set image for share dialog). That's work ok on main page (where I'd like to make ability share with whole application), but on pages of blog records I cann`t customize it. meta tag should be in , but all info (short text and image of blog post) I get later in body, so I can insert it. How can I manage with this? Or may be there is another way to share content with?
What blog engine are you using? If it is a wordpress - try this plugin http://wordpress.org/extend/plugins/facebook-share-new/ from offician facebook docs http://developers.facebook.com/docs/. Otherwise I'd suggest to find a facebook plugin for your blog engine using google and install it.

The title, link and description don't work

I've been reading guides and examples for a long time (hours) but I can't manage. I tried to use all html meta tag like title, description, and og:property. Also tried to use the link sharer and also to create a new blank page with just the info I want to share to facebook in order to test. Also I tried to generate an random url in php so to have always a different url variable (the url to share and also the url of the main page containing the script). I also grabbed (url linter) a lot of time the url to clean the cache of facebook. It always give me the title of the site domain as title or the url itself as the shared title and description. I don't know what to do.
The main web site is from joomla. In the code of index of joomla I put a php include if the url has the variable "articolo" id. This incuded php page has regulat head body etc. So maybe I facebook check the main meta of joomla first? So now I tried to open a popup with just the page for sharing. Look here: link
It's possible that the title is locked in, meaning that after X number of likes Facebook doesn't allow you to change it anymore. Can you give us an example URL you're having issues with?
EDIT
Ok, now the link you provided shows some very interesting output. http://modernolatina.it/wjs/index.php?option=com_content&view=article&id=96&Itemid=258&autore=6&articolo=6
First, you webserver, instead of sending back a 200 code, is sending back a 500 code.
Secondly the HTML your webserver is sending back has two HTML tags (Do a view source on the content returned)
Fix up those two issues and I think the linter will be happier with your page.
Test your page here:
http://developers.facebook.com/tools/debug