19 set_include_path(get_include_path().PATH_SEPARATOR.dirname(realpath(__FILE__)));
20 require_once
'OPiQuotations/log.inc';
25 ini_set(
'display_errors',
'stdout');
26 ini_set(
'display_startup_errors', 1);
27 ini_set(
'html_errors', 1);
31 assert_options(ASSERT_ACTIVE,
true);
32 assert_options(ASSERT_WARNING,
true);
33 assert_options(ASSERT_BAIL,
true);
38 ini_set(
'display_errors',
'stderr');
39 ini_set(
'display_startup_errors', 0);
40 ini_set(
'html_errors', 0);
44 assert_options(ASSERT_ACTIVE,
false);
45 assert_options(ASSERT_WARNING,
false);
46 assert_options(ASSERT_BAIL,
false);
48 set_error_handler(
'\OPiQuotations\error_handler');
53 mb_internal_encoding(
'UTF-8');
54 mb_regex_encoding(
'UTF-8');
55 mb_http_output(
'UTF-8');
56 mb_detect_order(
'UTF-8');
58 require_once
'OPiQuotations/OPiQuotations.inc';
61 $LABEL =
'Facebook - 1OPiCitationParJour';
68 #$quot = $opiquotations->quotation_by_id(9); 69 #$quot = $opiquotations->quotation_by_id(110); 70 #$quot = $opiquotations->quotation_by_id(459); 71 #$quot = $opiquotations->quotation_by_id(3062); 80 $text =
$quot->to_text_facebook(
'http://www.opimedia.be/OPiCitations/?id='.
$quot->id(),
85 echo mb_strlen(
$text).
'<pre>'.htmlspecialchars(
$text).
'</pre>';
93 require_once(
'.private/Facebook_login.inc');
95 $ch = curl_init(
'https://graph.facebook.com/'.$page_id.
'/feed');
103 array(CURLOPT_POST => 1,
104 CURLOPT_POSTFIELDS => array(
'access_token' => $access_token,
106 CURLOPT_RETURNTRANSFER => 1,
107 CURLOPT_SSL_VERIFYPEER =>
false));
140 $url =
'https://www.facebook.com/1OPiCitationParJour/posts/'.$msg_id;
146 echo
'</pre><a href="',
$url,
'">',
$url,
'</a>';
to_log($message)
Append $message in LOG_FILE.
Class to get OPiQuotation and informations from the databse.