Skip to content

Instantly share code, notes, and snippets.

@maximzasorin
Last active February 3, 2017 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximzasorin/f1a58aa428f20168e0e5c78a1536e564 to your computer and use it in GitHub Desktop.
Save maximzasorin/f1a58aa428f20168e0e5c78a1536e564 to your computer and use it in GitHub Desktop.
Обновление кэша фейсбука для шаринга страниц (HostCMS)
<?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