Youtube id controle

Gestart doorShahiem10 reacties56 weergaven

11 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Weet iemand hoe ik via PHP of js kan controleren of een bepaalde youtube id bestaat? smile En als die dan bestaat dat ik de titel kan ophalen van de video?

Bedankt

Gegroet,
Shahiem
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb wel wat.. Ik zal het ff opzoeken wink
Edit:

[COLOR= #0000BB]<?php
$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$youtube_link[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://www.youtube.com/watch?v="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$id[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]= @[/COLOR][URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$youtube_link[/COLOR][COLOR= #007700])){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Bestaat :O[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Bestaat niet![/COLOR][COLOR= #007700];
}[/COLOR]
?>


Live demo:
http://musiqu.nl/exists?id=WAcx5iUyeWY
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankjewel worshippy. Weet jij ook hoe ik de youtube titel kan ophalen?
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja dat weet ik ook wink Zal het ff opzoeken yummie
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Omdat die id daarvoor wel bestaat. yummie
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Titel:

[COLOR= #0000BB]<?php
$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$youtube_link[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://www.youtube.com/watch?v="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$id[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]= @[/COLOR][URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$youtube_link[/COLOR][COLOR= #007700])){[/COLOR]
    
    [COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<title>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]</title>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"YouTube"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" - &#x202a;"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700];
    
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Bestaat niet![/COLOR][COLOR= #007700];
}[/COLOR]
?>


Demo: http://musiqu.nl/title?id=WAcx5iUyeWY

Niels.. Jij weet zelf ook wel dat een YouTube-id niet zo lang is..
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ohw YT doet substr emo
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan doe ik er nog wel een controle van 11 tekens op. emo, thnx bas smile
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Was geen moeite Shahiem smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren