From fd7b39eaea5fc9f9d38db5ff3a58940362002732 Mon Sep 17 00:00:00 2001 From: Damien Calesse Date: Fri, 18 Jul 2014 13:19:02 +0200 Subject: [PATCH 1/3] Create WhydBridge.php --- bridges/WhydBridge.php | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 bridges/WhydBridge.php diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php new file mode 100644 index 00000000..1e6bcd6d --- /dev/null +++ b/bridges/WhydBridge.php @@ -0,0 +1,54 @@ +request = $param['u']; + $html = file_get_html('http://www.whyd.com/u/'.urlencode($this->request)) or $this->returnError('No results for this query.', 404); + $this->name = $html->find('div#profileTop', 0)->find('h1', 0)->plaintext; + } + else + { + $this->returnError('You must specify username', 400); + } + + for($i = 0; $i < 10; $i++) { + $track = $html->find('div.post', $i); + $item = new \Item(); + $item->name = $track->find('h2', 0)->plaintext; + $item->title = $track->find('h2', 0)->plaintext; + $item->content = $track->find('a.thumb',0) . '
' . $track->find('h2', 0)->plaintext; + $item->id = 'http://www.whyd.com' . $track->find('a.no-ajaxy',0)->getAttribute('href'); + $item->uri = 'http://www.whyd.com' . $track->find('a.no-ajaxy',0)->getAttribute('href'); + $this->items[] = $item; + } + } + public function getName(){ + return (!empty($this->name) ? $this->name .' - ' : '') .'Soundcloud Bridge'; + } + + public function getURI(){ + return 'https://www.soundcloud.com/'; + } + + public function getCacheDuration(){ + return 1; // 10 minutes + } +} From ecd81dfed0a61eeda9566b72baf372efcd89f0a1 Mon Sep 17 00:00:00 2001 From: Damien Calesse Date: Fri, 18 Jul 2014 13:31:40 +0200 Subject: [PATCH 2/3] Change WhydBridge.php --- bridges/WhydBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php index 1e6bcd6d..c728cd2c 100644 --- a/bridges/WhydBridge.php +++ b/bridges/WhydBridge.php @@ -41,7 +41,7 @@ class WhydBridge extends BridgeAbstract{ } } public function getName(){ - return (!empty($this->name) ? $this->name .' - ' : '') .'Soundcloud Bridge'; + return (!empty($this->name) ? $this->name .' - ' : '') .'Whyd Bridge'; } public function getURI(){ From d5ae7373198d584c542414a16f7a4a14ffd9585f Mon Sep 17 00:00:00 2001 From: Damien Calesse Date: Fri, 18 Jul 2014 13:33:54 +0200 Subject: [PATCH 3/3] WhydBridge.php --- bridges/WhydBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php index c728cd2c..6f98f574 100644 --- a/bridges/WhydBridge.php +++ b/bridges/WhydBridge.php @@ -45,7 +45,7 @@ class WhydBridge extends BridgeAbstract{ } public function getURI(){ - return 'https://www.soundcloud.com/'; + return 'http://www.whyd.com/'; } public function getCacheDuration(){