This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function API_YOUTUBE($video,$ancho,$alto) | |
{ ?> | |
<div class="embed-responsive embed-responsive-16by9 bordevideo"> | |
<script asyn defer> | |
var tag=document.createElement('script'); | |
tag.src ="https://www.youtube.com/player_api"; | |
var firstScriptTag =document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; | |
function onYouTubePlayerAPIReady(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Si son varias separar por comas | |
// en este ejemplo se carga la fuente "lato" | |
// debe colocarse en el head | |
// es para no usar | |
// <link href='https://fonts.googleapis.com/css?family=Lato:400,900,700' rel='stylesheet' type='text/css'> | |
<script type="text/javascript" async defer> | |
WebFontConfig={google:{families:['Lato:400,900,700']}}; | |
(function(){var wf=document.createElement('script'); | |
wf.src=('https:'==document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; | |
wf.type='text/javascript';wf.async='true'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extraer la ubicacion (latitud y longitud) | |
# desde Google Maps | |
# | |
function CLIMA($latitud,$longitud) | |
{ $url = "http://api.openweathermap.org/data/2.5/weather?lat=$latitud&lon=$longitud&units=metric"; | |
# -------------------- | |
$clima = file_get_contents($url); | |
$json = json_decode($clima); | |
$temperatura = $json->main->temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ------------------------------------------------------- | |
Script bajo los términos y Licencia | |
GNU GENERAL PUBLIC LICENSE | |
Ver Terminos en: | |
http://www.gnu.org/copyleft/gpl.html | |
Autor:Hector A. Mantellini (Xombra) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Lee un RSS/XML de una url determinada | |
# | |
function RSS($url,$imagen) | |
{ global $entries; | |
if (VERIFICA_ONLINE($url)){ | |
$noticias = simplexml_load_file($url); | |
$largo=700; | |
$lee=3; | |
$ciclo = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# verifica si una pagina esta online o existe | |
# | |
function VERIFICA_ONLINE($url) | |
{ @$headers = get_headers($url); | |
if (stristr ($headers[0],'200 OK')) | |
{ return true; } | |
else { return false; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GoogleAnalytics($UA, $dominio) | |
{ echo " | |
<script> | |
(function(i,s,o,g,r,a,m) | |
{i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', '$UA', '$dominio'); | |
ga('require', 'displayfeatures'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CREAR_TOKEN($TokenForm) | |
{ $token = md5(uniqid(microtime(), true)); | |
$token_time = time(); | |
$_SESSION['csrf'][$TokenForm.'_token'] = array('token'=>$token, 'time'=>$token_time); | |
return $token; | |
} | |
function VERIFICA_TOKEN($TokenForm, $token) | |
{ if(!isset($_SESSION['csrf'][$TokenForm.'_token'])) { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Extrae imagenes de un usuario y se filtra por los hastag | |
# | |
# Uso: | |
# Debe crear un archivo .txt de nombre data.txt | |
# Debe crear una carpeta de nombre grabar | |
# | |
/* |
NewerOlder