From 221ac239e1e31e5066799a8e44bb6e2fb569f016 Mon Sep 17 00:00:00 2001 From: teromene Date: Mon, 31 Aug 2015 22:59:08 +0200 Subject: [PATCH] Ajout d'un bridge pour Facebook --- bridges/FacebookBridge.php | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 bridges/FacebookBridge.php diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php new file mode 100644 index 0000000..378ac76 --- /dev/null +++ b/bridges/FacebookBridge.php @@ -0,0 +1,79 @@ +returnError('No results for this query.', 404); + } else { + + $this->returnError('You must specify a Facebook username.', 400); + + } + + + + $element = $html->find("[id^=PagePostsSectionPagelet-]")[0]->children(0)->children(0); + + foreach($element->children() as $post) { + + $item = new \Item(); + + if($post->hasAttribute("data-time")) { + + //Clean the content of the page + $content = preg_replace('/(?i)>
]+)>(.+?)div\ class=\"userContent\"/i', "", $post); + $content = preg_replace('/(?i)>