Skip to content

Instantly share code, notes, and snippets.

View willkriski's full-sized avatar

Will Kriski willkriski

View GitHub Profile
@willkriski
willkriski / proxy.php
Created June 15, 2012 12:46
Routes requests to Google Translate due to cross domain issues
<?php
header('Content-type: audio/mp3');
$text = urlencode($_GET['q']);
$content= file_get_contents('http://translate.google.com/translate_tts?tl=en&q=' . $text);
echo $content;
?>
@willkriski
willkriski / cURLFormPost
Created December 4, 2011 16:50
Submit to Form using cURL
<?php
//create array of data to be posted
$post_data['Z_ACTION'] = '';
$post_data['Z_START'] = '';
$post_data['P_TAX_AUTH'] = '604';
$post_data['P_STREET_NUMBER'] = '';
$post_data['P_STREET_NAME'] = 'CARRIAGE CRT';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
<!doctype html>
<html>
<head>
<script type='text/javascript' src='jquery-1.7.1.min.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$.getJSON("http://willkriski.com/?json=1&count=1",function(data) {
$('body').append('<a href="'+data.posts[0].url+'"><div id="homeblog">'+data.posts[0].title+'</div></a>');
});
});
$(document).ready(function(){
$.getJSON("http://willkriski.com/?json=1&count=1",function(data) {
$('body').append('<a href="'+data.posts[0].url+'"><div id="homeblog">'+data.posts[0].title+'</div></a>');
});