Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 01:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Youtube auf meiner eigenen HP

Discussion on Youtube auf meiner eigenen HP within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
>LoAdInG...<'s Avatar
 
elite*gold: 771
Join Date: Jan 2010
Posts: 1,047
Received Thanks: 409
Youtube auf meiner eigenen HP

Hi Leute

Weiß jemand wie ich YT über meine Homepage "laufen" lassen kann?
Also ich möchte das in der Adressleiste meine HP steht und man
trozdem Videos suchen und finden kann...
Das ist ja eigentlich sowas ähnliches wie ein Proxy...

Ich weiß das dies mit APIs von Youtube möglich ist, ich komme aber einfach nich klar...
Hier mal ein Link:

Ein Thx für jeden der hilft

PS: Ich meine nicht einzelne Videos
>LoAdInG...< is offline  
Old 12/16/2010, 17:06   #2
 
>LoAdInG...<'s Avatar
 
elite*gold: 771
Join Date: Jan 2010
Posts: 1,047
Received Thanks: 409
Quote:
Über PHP die Seite z.B. mit curl oder fsock. Anschließend das Ergebnis (im XML Format) parsen.
//
rofl = Wort für die Suche.
häääääääääää???
>LoAdInG...< is offline  
Old 12/16/2010, 19:21   #3
 
Krez's Avatar
 
elite*gold: 2437
Join Date: May 2009
Posts: 77
Received Thanks: 276
Hier ist dein Code, musst aber selber Anpassen.
PHP Code:
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Searching for videos by keyword</title>
    <style>
    img {
      padding: 2px; 
      margin-bottom: 15px;
      border: solid 1px silver; 
    }
    td {
      vertical-align: top;
    }
    td.line {
      border-bottom: solid 1px black;  
    }
    </style>
  </head>
  <body>
    <?php
    
// if form not submitted
    // display search box
    
if (!isset($_POST['submit'])) {
    
?>
    <h1>Keyword search</h1>  
    <form method="post" action="<?php echo 
      
htmlentities($_SERVER['PHP_SELF']); ?>">
      Keywords: <br/>
      <input type="text" name="q" />
      <p/>
      Items to display: <br/>
      <select name="i">
        <option value="10">10</option>
        <option value="25">25</option>
        <option value="50">50</option>
      </select>
      <p/>
      <input type="submit" name="submit" value="Search"/>  
    </form>
    <?php      
    
// if form submitted
    
} else {
      
// check for search keywords
      // trim whitespace
      // separate multiple keywords with /
      
if (!isset($_POST['q']) || empty($_POST['q'])) {
        die (
'ERROR: Please enter one or more search keywords');
      } else {
        
$q $_POST['q'];
        
$q ereg_replace('[[:space:]]+''/'trim($q));
      }
      
      
// set max results
      
if (!isset($_POST['i']) || empty($_POST['i'])) {
        
$i 25;
      } else {
        
$i $_POST['i'];
      }
      
      
// generate feed URL
      
$feedURL "http://gdata.youtube.com/feeds/api/videos?q={$q}&max-results={$i}";
      
      
// read feed into SimpleXML object
      
$sxml simplexml_load_file($feedURL);
      
      
// get summary counts from opensearch: namespace
      
$counts $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');
      
$total $counts->totalResults
      
$startOffset $counts->startIndex
      
$endOffset = ($startOffset-1) + $counts->itemsPerPage;       
      
?>
      
      <h1>Search results</h1>
      Showing items 
      <?php echo $startOffset?> to <?php echo $endOffset?>:
      <p/>
      
      <table>
      <?php    
      
// iterate over entries in resultset
      // print each entry's details
      
foreach ($sxml->entry as $entry) {
        
// get nodes in media: namespace for media information
        
$media $entry->children('http://search.yahoo.com/mrss/');
        
        
// get video player URL
        
$attrs $media->group->player->attributes();
        
$watch $attrs['url']; 
        
        
// get video thumbnail
        
$attrs $media->group->thumbnail[0]->attributes();
        
$thumbnail $attrs['url']; 
        
        
// get <yt:duration> node for video length
        
$yt $media->children('http://gdata.youtube.com/schemas/2007');
        
$attrs $yt->duration->attributes();
        
$length $attrs['seconds']; 
        
        
// get <gd:rating> node for video ratings
        
$gd $entry->children('http://schemas.google.com/g/2005'); 
        if (
$gd->rating) {
          
$attrs $gd->rating->attributes();
          
$rating $attrs['average']; 
        } else {
          
$rating 0
        }

        
// print record
        
echo "<tr><td colspan=\"2\" class=\"line\"></td>
        </tr>\n"
;
        echo 
"<tr>\n";
        echo 
"<td><a href=\"{$watch}\"><img src=\"$thumbnail\"/></a></td>\n";
        echo 
"<td><a href=\"{$watch}\">
        
{$media->group->title}</a><br/>\n";
        echo 
sprintf("%0.2f"$length/60) . " min. | {$rating} user 
        rating<br/>\n"
;
        echo 
$media->group->description "</td>\n";
        echo 
"</tr>\n";
      }
    }
    
?>
    </table>
  </body>
</html>
Krez is offline  
Thanks
1 User
Old 12/16/2010, 19:25   #4
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
geht viel einfacher .... einfach ein frame set ...
PHP Code:
<html>
  <
head>
    <
title>Seitentitel</title>
    <
meta name="description" content="">
      <
meta name="keywords" content="">
  </
head>
  <
frameset rows="*" framespacing="0" border="0" frameborder="NO">
    <
frame src="http://www.youtube.com" name="dein_content" scrolling="auto" noresize="">

  </
frameset>
  <
noframes>
    <
body>
    </
body>
  </
noframes>

</
html
... dann haste youtube auf deiner seite , aber deine url obn
NotEnoughForYou is offline  
Thanks
1 User
Old 12/16/2010, 20:06   #5
 
elite*gold: 0
Join Date: May 2010
Posts: 793
Received Thanks: 268
frames soll man nicht benutzen, warum weiss ich grade nicht.

seit html5 gehören frames auch nicht mehr zum Standart

ausserdem haben tags, die kein endtag haben, ein "/>" am ende, weil das xml entspricht. Und xml einfach besser als SGML ist (weil es einfach übersichtlicher und leichter in der verabeitung ist)
nkkk is offline  
Old 12/16/2010, 20:41   #6
 
>LoAdInG...<'s Avatar
 
elite*gold: 771
Join Date: Jan 2010
Posts: 1,047
Received Thanks: 409
ich habe einen der noch einfacher ist
PHP Code:
<body>
 <
iframe src="http://www.youtube.com"  style="border:1px #FFFFFF none;" name="TestTest" scrolling="auto"  frameborder="1" align=aus marginheight="0px" marginwidth="0px"  height="600" width="900"></iframe></body
>LoAdInG...< is offline  
Reply


Similar Threads Similar Threads
4chan vs. YouTube am “YouTube Porn Day”
08/14/2011 - User Submitted News - 42 Replies
Der YouTube-Account von LuckeyWes123 wurde aufgrund seiner plötzlichen Beliebtheit in den 4chan Foren gesperrt, die sich in 15000 Abonnenten und zahllosen Tribute-Videos äußerte. Eins davon kann man sich unten anschauen. Das lassen sich die 4chan Benutzer natürlich nicht gefallen und wählen mit YouTube ihr erstes Opfer im neuen Jahr, indem sie den 6. Januar zum “YouTube Porn Day” ausrufen. Dafür soll jeder Teilnehmer unverdächtige Videos mit Pornobildern oder kurzen Porno-Szenen versehen,...
[Buy] Youtube Intro + Youtube Abbos [Sell] E*Gold
01/24/2011 - elite*gold Trading - 65 Replies
Jo hey Leute, kaufe ein geiles Youtube Intro. Am besten ihr macht ein Beispiel. Danach zeigt ihr es mir per PN und nennt den Preis. Wenn ich einverstanden bin, erstellt ihr eine Treasure. In der Treasure ist der download vom Intro Projekt und mit welchen Programm es gemacht wurde drin, damit ich den Text etc. beliebig ändern kann. ------------------------------------------------- ------------------------------------------ Kaufe sehr viele Youtube Abbos. Pro Abbo 1 e*gold.
Suche HP Dateien um sich einen eigenen Hompegae für eigenen P-server zu machen.
10/03/2009 - Metin2 Private Server - 2 Replies
HI, ich suche wie oben beschrieben HTML dateien von zb. e161 oda anderen. Hoffe mann kan sich auch gut bearbeiten damit man sich unter meiner Datenbank accounts macht. mFG NiggaJoh:mofo:
[Youtube]KRIEG Level 80 Mage Arathi Basin Ownage [/Youtube]
05/17/2009 - Off Topic - 1 Replies
YouTube - Kanal von Level80EliteMage Check out my channel, rate comment subscribe



All times are GMT +1. The time now is 01:03.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.