I need help for my new plugin(College Humor + BeautifulSoup)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ourclass Offline
Junior Member
Posts: 1
Joined: Mar 2011
Reputation: 0
Location: UK
Post: #11
Hi Guys,

I found your thread on google and was wondering if you could help me.

I want to grab videos from collegehumor. For this I need to strip title and image from collegehumor.

Code:
public function title()
    {
        $this->parse();

        switch($this->_aData['site_id'])
        {
case 'collegehumor':
                preg_match('/item_title[^>]+>([^<]+)/ms', $this->_aData['html'], $aMatches);
                if (isset($aMatches[1]))
                {
                    $sTitle = trim($aMatches[1]);
                }
                break;

and for the picture:

Code:
public function image($iId)
    {
        switch($this->_aData['site_id'])
        {
case 'collegehumor':
                preg_match('/image_src[^=]+="([^"]+)/ms', $this->_aData['html'], $aMatches);
                if (isset($aMatches[1]))
                {
                    $sImage = trim($aMatches[1]);
                }
                break;

Above code does everything except getting me the title and the picture. Sad
Later I would like to implement also other things and I really would appreciate if somebody could help me.

Kind regards,

webmaster
http://www.ourclass.co.uk
(This post was last modified: 2011-03-21 18:25 by Ourclass.)
find quote
Post Reply