YouTube url conversion system for embed

1

Good afternoon, I'm trying to create a system, where I get a url youtube form, convert to embed and save to a database. This is a classified site, I do not know if this is the best way, I did not want to spend a lot of space, so I opted for youtube videos, I'd better ask the user for the embed link, if not someone can explain how to create the conversion system? Thank you.

    
asked by anonymous 10.05.2015 / 21:27

1 answer

1

Youtube embed link: https://www.youtube.com/embed/[id_do_video]
Example: https://www.youtube.com/embed/D_E58tNUJRs

And in case you get recent youtube videos use GoogleAPI and collect the feed link from recent / highest rated videos.

Here link has this link that can help you in relation to channel search for channels.

And to add the value to the database (I'll be using mysql in that case, because it's less complicated to work with) use this [php and mysql]:

<?php 
// conecta com o servidor 
$mysql_conexao = mysql_connect(servidor, usuario, senha);

// prepara o comando
$exec = "INSERT INTO nome_da_tabela (coluna1, coluna2) VALUES (value1, value2)";

// executa e verifica o comando 
if($mysql_conexao->query($exec) == TRUE){ //inserido com sucesso! }

?>
    
10.05.2015 / 21:52