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 | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; | |
switch( true ){ | |
case preg_match('/iphone|ipad/si',$user_agent): | |
$url = 'https://itunes.apple.com/us/app/whatsapp-messenger/id310633997?mt=8'; | |
break; | |
case stristr($user_agent, 'android'): |
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
$url = 'http://www.bedca.net/bdpub/procquery.php'; | |
$xml = '<?xml version="1.0" encoding="utf-8"?><foodquery><type level="3e"/><selection><atribute name="r_id"/><atribute name="citation"/></selection><condition><cond1><atribute1 name="citation"/></cond1><relation type="NOTEQUAL"/><cond3>null</cond3></condition><order ordtype="ASC"><atribute3 name="r_id"/></order></foodquery>'; | |
$context = stream_context_create(array('http' => array( | |
'method' => "POST", | |
'header' => "Content-Type: text/xml", | |
'content' => $xml | |
))); | |
$xml = simplexml_load_string( file_get_contents($url, false, $context) ); |
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
{ | |
"name": "Hello world", | |
"description": "Hello world app", | |
"launch_path": "/app/index.html", | |
"icons": { | |
"128": "http://domain.com/app/app128.png" | |
}, | |
"developer": { | |
"name": "Your name", | |
"url": "http://domain.com" |
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
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc> | |
http://betabeers.com/forum/cuantos-enlaces-maximo-permite-un-sitemapsxml-145/ | |
</loc> | |
<priority>0.1</priority> | |
<changefreq>monthly</changefreq> | |
<lastmod>2013-05-13</lastmod> | |
</url> | |
<url> |
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 | |
// buscar eventos dentro de 2 dias en la base de datos | |
$date = date('Y-m-d',strtotime("+2 days")); | |
$consulta_sql = "SELECT titulo, mensaje, email FROM eventos WHERE date LIKE '" . $date . "%'"; | |
$eventos = $db->queryAll($consulta_sql); | |
// si hay eventos enviamos un email al organizador | |
if( $eventos ){ | |
foreach( $eventos as $evento ){ |
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 | |
$total = $db->queryOne("SELECT COUNT(*) FROM Users"); | |
echo $total; | |
?> |
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 | |
// your firefox os apps submissions here https://marketplace.firefox.com/developers/submissions | |
$app_name = 'betajobs'; | |
$url = 'https://marketplace.firefox.com/app/'.$app_name.'/statistics/installs-month-20120601-'.date('Ymd').'.json'; | |
$dates = json_decode( file_get_contents( $url ) ); | |
$total = 0; | |
if( $dates ){ |
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 | |
// Public Api class, get it here https://es.mailjet.com/docs/api | |
require 'class.mailjet.php'; | |
// Get your mailjet API keys here https://es.mailjet.com/account/api_keys | |
$apiKey = ''; | |
$secretKey = ''; | |
$mj = new Mailjet($apiKey, $secretKey); | |
$mj->debug = 0; |
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 | |
// http://appannie.zendesk.com/categories/20082753-Analytics-API | |
$username = '[email protected]'; | |
$password = ''; | |
$account_id = 123; | |
$app_id = 123; | |
$start_date = '2012-01-01'; | |
$ch = curl_init("https://api.appannie.com/v1/accounts/".$account_id."/apps/".$app_id."/sales?start_date=".$start_date."&end_date=".date("Y-m-d")); |
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 | |
// descarga las clases necesarias | |
// https://github.com/abraham/twitteroauth/tree/master/twitteroauth | |
require BASE_PATH . 'class/OAuth.php'; | |
require BASE_PATH . 'class/twitteroauth.php'; | |
// crea una app en twitter y copia tus keys | |
// https://dev.twitter.com/ | |
define('TWITTER_CONSUMER_KEY',''); |