Chinaunix首页 | 论坛 | 博客
  • 博客访问: 575671
  • 博文数量: 207
  • 博客积分: 10128
  • 博客等级: 上将
  • 技术积分: 2440
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-10 21:40
文章分类

全部博文(207)

文章存档

2009年(200)

2008年(7)

我的朋友

分类: 系统运维

2009-04-29 14:13:17

The Challenge is Over!

The 140 Characters Webapp Challenge is now over! If by chance you don’t know what it was, read or see . It was great 2 weeks, everybody. You showed some awesome skills, and really raised to The Challenge! Kudos :) And thanks for making it all so exciting for all of us!

I have wrapped up all of your apps into this long, 32 apps list, which all are indeed functional and below 140 chars! (plus 4 that are interesting, but too long) You can VOTE for ONE of your favorite apps. And yes, the voting script is 140 chars too!

(url)


Here is the final wrap-up of the coders and their apps, almost in the order of appearance ;] If you wish to change something in your description, ! To see how these were born, follow .

Voting!

You can vote for your ONE favorite script! Just click the VOTE link below the favorite source code! Voting is managed by yet another 140 characters app I made — it even does IP filtering to block repeated votes. If you get 0 then it means you already voted. UPDATE: Voting is now closed!

use CGI':all';$i=$ENV{'REMOTE_ADDR'};$v=(param 0)=~/^(\d+)$/?$1:0;open V,';open V,'>>v';print header.($j!~/$i/?print V "!$v&$i":0)

Results are displayed by a 150160 characters app, because I wanted to make nice chart bars using input fields. But it can be done in 140 chars as well, if just plain text is displayed.

use CGI':all';print header;open V,'v';%v=();$v=;while($v=~/!(\d+)&/g){$v{$1}++};for$i(sort{$a<=>$b}keys%v){print p.b("$i.").br.input({size=>$v{$i}}).$v{$i}};

OK! Enough of this talking, let’s get down to business! Here are the awesome coders and their apps!

Coders and the webapps

1. Micro-Twitter in 154 chars of PHP (props for being the first!):

’);fclose($q);}?>

2. Micro-Twitter in 139 chars of PHP (modification of Issac’s code):

$a”);fclose($q);echo $a;}?>

3. Age Guessing in 140 chars of JS:

var c=0;var i=35;do{var x=confirm(‘are you ‘+i+’?\n(ok=Y)’);i=Math.floor(Math.random()*70);c++;}while(!x);alert(‘I only took ‘+c+’ tries!’);

Example:

4. Micro-Twitter in 99 chars of JS:

(”

[go]”);$(‘p’).click(function(){$(‘body’).append($(‘input’).val() + ‘


’);});

Example:

5. Micro-Twitter in 134 chars of PHP:

$s$f[0]”:’‘;fwrite(fopen(‘a’,‘w’),$a);echo$a;

6. Time of life counter in 146 chars of JS:

d=prompt(‘DOB?’,‘DD-MM-YYYY’).split(/[^\d]/);d=(new Date()-new Date(d[2],d[1],d[0]))/1000;alert(d+’ seconds\n’+d/60+’ minutes\n’+d/60/60+’ hours’)

Example:

7. Micro-Twitter in 129 chars of PHP:

’;fputs(fopen(a,a),$_GET[a].”\n
”);$a=file(a);krsort($a)?>

8. The same, but without sorting, just 82 chars:

’;fputs(fopen(a,a),$_GET[a].’
’)?>

9. Delicious links in 136 chars of PHP:

channel->item as$a)echo$a->title.’‘;?>

10. Get HTTP Code of URL in 133 chars of PHP:


11. Resize JPG by half in 186 chars of PHP:


12. copy in 139 chars of PHP:

’;$b=’
’.$_GET[a].’ - ‘;if(strstr($b,’?’))fputs(fopen(a,a),rand(0,1)?$b.‘yes’:$b.‘no’);echo@implode( ,file(a))?>

13. A clone of in 135 chars of PHP:

’;$a=$_GET[s];echo(@file((stripos($a,”:”))?$a:“http://”.$a))?‘just you’:‘its down’;?>

Example:

14. Micro-Twitter in 140 chars of Ruby (including own webserver!):

%w[rubygems sinatra].each{|w|require w};get'/'do;m=params[:m];open("f","a"){|f|f<
%pre&=`cat f`'end

Code:

15. Micro-Twitter in 136 chars of Ruby (including own webserver!):

require'rubygems';require'sinatra';get("/"){r="
";t=params[:t];`echo '
#{t}' >> t` if t;r<<`tail -r t`;r}

Code:

adamo

16. Random Quotes in 81 chars of language I can’t recognize ;] :

echo 80 stream tcp nowait nobody /usr/games/fortune fortune -a >> /etc/inetd.conf

Example:
Blog post: http://blog.postmaster.gr/2009/02/13/does-this-count-as-a-web-application/

17. Odd or Not game in 140 chars of JS:

function
x(){if(confirm("odd?")&&((Math.floor(Math.random()*10))%2))alert(":)");else
alert(":(");if(confirm("rpt?"))x()}x()

Example:

18. 1 or 0 game in 130 chars of JS:

function x(){if(confirm(”1?”)&&(Math.round(Math.random())))alert(”:)”);else alert(”:(”);if(confirm(”rpt?”))x()}x()

Example:
Blog post:

19. Micro-Twitter in 136 chars of PHP:

”);}echo@readfile(a)?>

20. More featured Micro-Twitter in 141 chars of PHP:

0){$h=fopen(a,“a”);fwrite($h,$_GET[a].”
”);}echo@readfile(a)?>

cherouvim

21. Epilepsy Causer in 114 chars of JS:

{r=0;setInterval(function(){document.body.style.background=(r++%2==0?'#'+r%7+r%9+r%8:'0')},50);void(0)}

Example: launch JS
Blog post: http://blog.cherouvim.com/re-the-140-character-webapp-challenge/

22. Many-Features Micro-Twitter in 140 chars of PHP:

'')file_put_contents(n,"
".date(YmdHi).": $n$m");include n;

Example:

23. A PHP web framework in 131 chars of PHP:

require __DIR__.’/c.php’;
if (!is_callable($c = @$_GET[‘c’] ?: function() { echo ‘Woah!’; }))
  throw new Exception(‘Error’);
$c();

Homepage:

24. Copy of downforeveryoneorjustme.com in 135 chars of Perl:

use CGI’:all’;print header.’down4u?:’.br.textarea(‘a’).br.submit;if($a=param(‘a’)){`ping -c1 $a.`;print h2($? ? “down”:“just4u”)}

25. Copy of Twitto.org web framework in 111 chars of Perl:

use CGI’:all’;($a,$b)=path_info=~/.([^\/]+).(.*)/;eval"use $a”;print header.(!$@&&$a->can($b)?$a->$b():“no go”)

26. Link to banner in 130 chars of Perl:

use CGI’:all’;print header.’message:’.textfield(‘m’).submit;if($a=param(‘m’)){print’‘.`/usr/games/banner $a`.’
’}

27. Guessing game of numbers between 0-20 in 140 chars of JS:

r=Math.round(Math.random()*20);for(c=1;c<=10;c++){g=prompt(‘Guess’,’‘);if(g==r){alert(‘Won’);break;}if(!g){break;}if(c==10){alert(‘Lost’);}}

Example:

28. RSS/RDF parser with formatted output in 135 chars of PHP:

([^<]+)/’,$l,$m))echo$m[1]==‘link’?” link
”:$m[2]?>

Example:

29. Micro-twitter using Continuity in 140 chars of Perl:

use Continuity;Continuity->new->loop;sub main{($r)=@_;while(){$r->print('');$r->next;$x+=$r->param('m');$r->print($x)}}

Blog post:

30. Word counter using Continuity in 139 chars of Perl:

use Continuity;Continuity->new->loop;sub main{while(){$m=$_[0]->print(”$m=$l”)->next->param(‘m’);$l=()=$m=~/\w+/g}}

31. Social linking - redirects to URL left by the previous person - in 140 chars of PHP:

 

Example:
Homepage:

32. Self-contained webserver using Continuity in 140 chars of Perl:

use Continuity;Continuity->new->loop;sub main{while(){$m=$_[0]->print(”$m
”)->next->param(‘m’);$m=~y/a-z/n-za-m/}}#rot13!

Twitter:

33. Album Art Finder in 192 chars of PHP:

ArtistAlbum

album->image).'>';

Example:
Code:

34. Micro-Twitter in 241 chars of PHP:

""){file_put_contents("1",$m.'
',FILE_APPEND);}for ($i=0;$i<11;$i++){echo $f[$i];}?>

Code:

Jim

35. Micro-Twitter in 308 chars of Ruby:

require’camping’;Camping.goes:T;module T::Models;class Tinput.d;redirect’/’;end;end;end;module T::Views;def i;form(:method=>:post){;input:type=>:submit;input:name=>‘d’,:type=>:text;};@s.each{|t|hr t.d};end;end

36. Micro-Twitter that started it all in 140 chars of Perl:

use CGI':all';print header.'
'.submit.textfield 0,'',99;open F,'<0';print $f=(param 0)=~/1234 (.*)/?hr.$1.:;open F,'>0';print F$f

Example:
Code: http://www.f055.net/images/uploads/140charswebapp.zip
Blog post:

Final words

I am very happy it all turned out so well. I will be thinking of a next challenge for you soon, if it again magically pops into my mind, or I’ll get inspired as I did in this challenge. Or maybe you have a really exciting idea? Share your thoughts in the comments! You may also want to and message me directly with your suggestions :)

It was fun, guys! You should be all proud. Because, as I said before, it’s easy to write a lot of code. The challenge is to write short, but packed with features. That’s what it was all about. And you all proved it can be done, with awesome results! Thanks!

阅读(1744) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~