<commit_before><?php

namespace veneliniliev\FacebookSharingDebugger;

/**
 * Something
 *
 */
class FacebookSharingDebugger {


    /*
		 * https://developers.facebook.com/docs/opengraph/using-objects
		 *
		 * Updating Objects
		 *
		 * When an action is published, or a Like button pointing to the object clicked,
		 * Facebook will 'scrape' the HTML page of the object and read the meta tags.
		 * The object scrape also occurs when:
		 *
		 *      - Every 7 days after the first scrape
		 *
		 *      - The object URL is input in the Object Debugger
		 *           http://developers.facebook.com/tools/debug
		 *
		 *      - When an app triggers a scrape using an API endpoint
		 *           This Graph API endpoint is simply a call to:
		 *
		 *           POST /?id={object-instance-id or object-url}&scrape=true
		 */

    public function __construct() {
        //
    }

    public static function reload($url) {
        $graph = 'https://graph.facebook.com/';
        $post = 'id=' . urlencode($url) . '&scrape=true';

        return self::send_post($graph, $post);
    }

    private function send_post($url, $post) {
        $r = curl_init();
        curl_setopt($r, CURLOPT_URL, $url);
        curl_setopt($r, CURLOPT_POST, 1);
        curl_setopt($r, CURLOPT_POSTFIELDS, $post);
        curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($r, CURLOPT_CONNECTTIMEOUT, 5);
        $data = curl_exec($r);
        curl_close($r);
        return $data;
    }
}
<commit_msg>json decoded response<commit_after><?php

namespace veneliniliev\FacebookSharingDebugger;

/**
 * Something
 *
 */
class FacebookSharingDebugger {


    /*
     * https://developers.facebook.com/docs/opengraph/using-objects
     *
     * Updating Objects
     *
     * When an action is published, or a Like button pointing to the object clicked,
     * Facebook will 'scrape' the HTML page of the object and read the meta tags.
     * The object scrape also occurs when:
     *
     *      - Every 7 days after the first scrape
     *
     *      - The object URL is input in the Object Debugger
     *           http://developers.facebook.com/tools/debug
     *
     *      - When an app triggers a scrape using an API endpoint
     *           This Graph API endpoint is simply a call to:
     *
     *           POST /?id={object-instance-id or object-url}&scrape=true
     */

    public static function reload($url) {
        $graph = 'https://graph.facebook.com/';
        $post = 'id=' . urlencode($url) . '&scrape=true';

        $r = curl_init();
        curl_setopt($r, CURLOPT_URL, $graph);
        curl_setopt($r, CURLOPT_POST, 1);
        curl_setopt($r, CURLOPT_POSTFIELDS, $post);
        curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($r, CURLOPT_CONNECTTIMEOUT, 5);
        $data = curl_exec($r);
        curl_close($r);
        return json_decode($data);
    }
}

{'fraction_non_alphanumeric': 0.11372277912201867, 'fraction_numerical': 0.00276529554096094, 'mean_word_length': 2.3036529680365296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792180', 'n_tokens_mistral': 948, 'n_tokens_neox': 864, 'n_words': 242}