Author Topic: process_google.inc.php not work  (Read 1891 times)

0 Members and 1 Guest are viewing this topic.

Offline zamile

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
process_google.inc.php not work
« on: April 07, 2009, 04:10:48 PM »
hi
process_google.inc.php  dont work

help  ??? ???

Offline Chris (krissy)

  • Project Leader
  • Sr phpd Member
  • *****
  • Posts: 219
  • Karma: 1000
    • View Profile
    • PHPDirector
Re: process_google.inc.php not work
« Reply #1 on: April 07, 2009, 04:30:20 PM »
Explain?

Offline zamile

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: process_google.inc.php not work
« Reply #2 on: April 07, 2009, 05:45:23 PM »
dont grab image and Description

Offline videonl

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
    • videonl
Re: process_google.inc.php not work
« Reply #3 on: April 07, 2009, 07:40:17 PM »
this was the fix on from the old forum,,still working,i just test it.But not grab the author.Maybe somebody have the fix for author.

Code: [Select]
<?php
/**
 * Gets Google Video link from eg http://www.Google Video.com/watch?v=xxxxxxxxxxx&eurl=
 *
 * @param http://www.Google Video.com/watch?v=xxxxxxxxxxx
 * @return Google Video id
 */
function getgvid($url){

//checks if valid Google Video link

$checkgv explode("."$url);

if (
$checkgv[1] == "google" ){

//gets vid id
$gv_start explode("docid=",$url,2);
$gv_end explode("&",$gv_start[1],2);
$gotid $gv_end[0];
return 
$gotid;
}
}
/**
 * Gets Author from Google Video id
 *
 * @param Google Video Id
 * @return $gv_author
 */
function getauthor($videoid){
$gv_xml_author_string = @file_get_contents("http://video.google.com/videofeed?docid=".$videoid);
$gv_xml_author_start explode("<author>",$gv_xml_author_string,2);
$gv_xml_author_end explode("</author>",$gv_xml_author_start[1],2);
$gv_author addslashes($gv_xml_author_end[0]);
return 
$gv_author;
}

/**
 * Gets Title from Google Video id
 *
 * @param Google Video Id
 * @return $gv_title_noslash
 */
function gettitle($videoid){
$gv_xml_title_string = @file_get_contents("http://video.google.com/videofeed?docid=".$videoid);
$gv_xml_title_start explode("<title>",$gv_xml_title_string,2);
$gv_xml_title_end explode("</title>",$gv_xml_title_start[1],2);
$gv_title addslashes($gv_xml_title_end[0]);
$gv_title_noslash $gv_xml_title_end[0];
return 
$gv_title_noslash;
}

/**
 * Gets description from Google Video id
 *
 * @param Google Video Id
 * @return $gv_description
 */
function getdescription($videoid){
$gv_xml_description_string = @file_get_contents("http://video.google.com/videofeed?docid=".$videoid);
$gv_xml_description_start explode("<description>",$gv_xml_description_string,2);
$gv_xml_description_end explode("</description>",$gv_xml_description_start[1],2);
$gv_description addslashes($gv_xml_description_end[0]);
return 
$gv_description;
}


/**
 * Gets description from Google Video image
 *
 * @param Google Video image
 * @return $gv_description
 */
function getimage($videoid){
$gv_xml_image_string = @file_get_contents("http://video.google.com/videofeed?docid=".$videoid);
$gv_xml_image_start explode('<media:thumbnail url="',$gv_xml_image_string,2);
$gv_xml_image_end explode('"',$gv_xml_image_start[1],2);
$gv_image addslashes($gv_xml_image_end[0]);
return 
$gv_image;
}




//check if its allready there
$videoid_untrim getgvid($videourl);

$videoid trim($videoid_untrim);  //removes whitespaces at the end
$smarty->assign('videoid'$videoid);
if($videoid !== null){
$title  safe_sql_insert(gettitle($videoid));
$smarty->assign('title'$title);

$author safe_sql_insert(getauthor($videoid));
$smarty->assign('author'$author);

$des    safe_sql_insert(getdescription($videoid));
$smarty->assign('description'$des);

$thumb[0]  = getimage($videoid);
$smarty->assign('image'$thumb);

$smarty->assign('vidtype''GoogleVideo');



}//check for blank end
 
?>

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: process_google.inc.php not work
« Reply #4 on: April 08, 2009, 12:09:30 AM »
I was looking into it and it seems as if google no longer puts the author info were the script grabs it(which is the only way to do so)....

So what i did was cut the code down got rid of the author code in the process_google.inc.php..... and it seems to run fine and just as good if not faster


To find the code go to...
http://phpdirector.co.uk/forum/index.php?topic=43.0