Created
November 4, 2012 02:20
-
-
Save ha1t/4009828 to your computer and use it in GitHub Desktop.
PHPMatsuri 2012 投票サポートシステム
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 | |
$url = 'https://docs.google.com/spreadsheet/viewform?formkey=dHlaWTV5U0xvVWdaZ0lNNkNIQ1dkeXc6MA'; | |
$names = array( | |
'halt', | |
'yando', | |
'takahashiyuya', | |
'tanakahisateru', | |
'shin1x1', | |
'remore', | |
's_kozo', | |
'cakephper', | |
'sio_19851001', | |
'hamaco', | |
'k1LoW', | |
'Garyuten', | |
'anatoo', | |
'halt', | |
'sanojimaru', | |
'ganchiku', | |
'fantasista_21jp', | |
'ooharabucyou', | |
'makies', | |
'kensei_kick', | |
'kiyotune', | |
'bito_coffee', | |
'yando', | |
'harisenbon79', | |
'goodoo', | |
'itm_kiyo', | |
'withelmo', | |
'msng', | |
'oppara', | |
'tekapo', | |
'hajikami', | |
'@yasulab', | |
's_hagiwara', | |
'ysaotome', | |
'msuzuuuki', | |
'w_enomoto', | |
'mawatarin', | |
'sadapon2008', | |
'@JUNKI_ITO', | |
'debility', | |
'sugasaki', | |
'sizuhiko', | |
'kanjihtmt', | |
'suzuki', | |
'mon_sat', | |
'papettotv', | |
'kagasawa', | |
'ryuring', | |
); | |
$key = array_rand($names); | |
$name = $names[$key]; | |
$comments = array( | |
'よかった', | |
'なかなかよかった', | |
'がんばってた', | |
'楽しそうだった', | |
'プレゼン上手だった', | |
'CandyCane試してみたい', | |
'CandyCaneよかった', | |
'CandyCane楽しそうだった', | |
'CandyCane試す', | |
); | |
$html = file_get_contents($url); | |
$html = str_replace('<head>', '<head><base href="http://docs.google.com/spreadsheet">', $html); | |
$html = str_replace('name="entry.1.single" value=""', 'name="entry.1.single" value="12A"', $html); | |
$html = str_replace('name="entry.0.single" value=""', 'name="entry.0.single" value="'. $name . '"', $html); | |
$html = str_replace('value="3"', 'value="3" checked="checked"', $html); | |
$key = array_rand($comments); | |
$comment = $comments[$key]; | |
$html = str_replace('</textarea>', $comment . '</textarea>', $html); | |
$html = str_replace('"submit"', '"submit" style="border-style: none; font-size: 5em; width: 100%; padding: 5em !important;"', $html); | |
$html = str_replace('<br>', '<br><input type="submit" style="font-size: 12em; border-style: none;" name="submit" value="押してみてね!" />', $html); | |
echo $html; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://project-p.jp/halt/vote.php