Last active
February 3, 2017 13:07
-
-
Save maximzasorin/f1a58aa428f20168e0e5c78a1536e564 to your computer and use it in GitHub Desktop.
Обновление кэша фейсбука для шаринга страниц (HostCMS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Обновляем кэш фейсбука | |
// https://developers.facebook.com/docs/sharing/opengraph/using-objects#update | |
$oSite = Core_Entity::factory('Site', CURRENT_SITE); | |
$oSiteAlias = $oSite->getCurrentAlias(); | |
$offerUrl = 'http://' . $oSiteAlias->alias_name_without_mask . $oOfferItem->getUrl(); | |
$oCoreHttp = Core_Http::instance() | |
->timeout(1) | |
->url('https://graph.facebook.com/?id=' . $offerUrl . '&scrape=true') | |
->method('POST') | |
->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment