I am looking to use a hash that is given in through a URL (www.example.com/index.html#myhash) and use it in the page's metadata that Facebook and Twitter can then retrieve to make a share card like this: https://dev.twitter.com/docs/cards/types/photo-card. Is this possible? Or would it be better to just use a PHP $_GET[] variable? I'm trying to keep the page static so the hash would be ideal, but I'm fairly sure I can't dynamically create the meta tag with JS because Twitter and Facebook will not execute that code. Thanks for help!
相关问题
- Angular RxJS mergeMap types
- facebook error invalid key hash for some devices
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
Correct, creating the meta elements client-side will not work because those crawlers don’t execute any client-side scripting code, they just look at the HTML code they get.
And the hash part of an URL is only of client-side importance, so it does not even get passed to the server when making an HTTP request – so generating those meta elements server-side based on the hash is also not possible.
And finally, changing the hash part of an URL does not make it a different URL – so this is not compatible with Facebook’s Open Graph philosophy, where the equation is one URL == one OG object.