From c4ca8c291beffb84430edb3d0d92260c53ad0049 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Mon, 15 Oct 2012 16:42:24 -0600 Subject: [PATCH] basic SocialNoise\Facebook Trust me, this hurts me more than it does you. --- SocialNoise/Facebook.php | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 SocialNoise/Facebook.php diff --git a/SocialNoise/Facebook.php b/SocialNoise/Facebook.php new file mode 100644 index 0000000..5dd2526 --- /dev/null +++ b/SocialNoise/Facebook.php @@ -0,0 +1,64 @@ +search($text, $qty); + + $html = ''; + + $count = 0; + foreach ($result->data as $activity) { + + if ($count++ > $qty) + break; + + $html .= ''; + + if (isset($activity->picture)) + $html .= ''; + elseif (isset($activity->icon)) + $html .= ''; + else + $html .= ""; + + $html .= '"; + } + + $html .= '
[' . htmlspecialchars($activity->from->name) . '] '; + + if (isset($activity->message)) + $html .= (Text::truncate(htmlspecialchars($activity->message), 50)); + elseif (isset($activity->story)) + $html .= (Text::truncate(htmlspecialchars($activity->story), 50)); + + $html .= '
'; + $time = '' . htmlspecialchars($activity->created_time) . ""; + if (isset($activity->link)) + $html .= '' . $time . ''; + else + $html .= $time; + + $html .= "
'; + + return $html; + } + +}