七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
416: ◆GodofTripY [sage] 2006/08/01(火) 01:25:49 ID:??? ($name, $tripkey) = split(/\#(.+)/, $form{'name'}); if($tripkey){ $salt = substr($tripkey.'H.', 1, 2); $salt =~ tr/\x3A-\x40\x5B-\x60\x00-\x2D\x7B-\xFF/A-Ga-f./; $salt =~ s/[^\.-z]/\./g; $trip = '◆'. substr(crypt($tripkey, $salt), -10);} print "$name$trip"; 2chトリップ判定。 http://medaka.5ch.net/test/read.cgi/php/1036141603/416
417: nobodyさん [sage] 2006/08/01(火) 02:06:48 ID:??? >>416 気持ちはわかるがそれはwebprogではない http://medaka.5ch.net/test/read.cgi/php/1036141603/417
418: nobodyさん [sage] 2006/08/01(火) 03:23:08 ID:??? >>416 どこかで見た事があるんだが^^ http://medaka.5ch.net/test/read.cgi/php/1036141603/418
419: nobodyさん [sage] 2006/08/01(火) 04:17:36 ID:??? >>416 2chってcrypt()なんだね http://medaka.5ch.net/test/read.cgi/php/1036141603/419
420: nobodyさん [] 2006/10/13(金) 18:11:25 ID:UA0b1MaA 6行RSSリーダー 設置して.cgi?以降にfeedのURLを入力 モジュールてんこ盛りなのでもっと短く書けるはず use LWP::Simple;use CGI":all";use XML::RSS;$h = new CGI;$r = new XML::RSS; $r->parse(get("$ENV{'QUERY_STRING'}"));%c = %{$r->{'channel'}}; print $h->header.'<a href="'.$c{'link'}.'">'.$c{'title'}. "</a><br>$c{'description'}<br>";print "<ul>";for $item (@{$r->{'item
s'}}){ print '<a href="'.$item->{'link'}.'">'.$item->{'title'}. "</a><br>$item->{'description'}<br>";}print "</ul>".$h->end_html; http://medaka.5ch.net/test/read.cgi/php/1036141603/420
421: sage [sage] 2006/10/13(金) 18:14:55 ID:??? test http://medaka.5ch.net/test/read.cgi/php/1036141603/421
422: nobodyさん [] 2006/10/13(金) 18:17:21 ID:yRLkeiwT >>421 まさか7行で2chに書き込めるスクリプトを?! http://medaka.5ch.net/test/read.cgi/php/1036141603/422
423: nobodyさん [sage] 2006/10/13(金) 22:26:56 ID:??? 7行も要らんけどな http://medaka.5ch.net/test/read.cgi/php/1036141603/423
424: nobodyさん [sage] 2006/10/13(金) 23:51:02 ID:??? 書き込みのモジュールなんてあった??<<Perl脳 http://medaka.5ch.net/test/read.cgi/php/1036141603/424
425: nobodyさん [sage] 2006/10/14(土) 00:15:13 ID:??? 書き込みっつーかPOSTするだけだろ http://medaka.5ch.net/test/read.cgi/php/1036141603/425
426: nobodyさん [sage] 2006/10/14(土) 00:45:55 ID:??? >>425 単にPOSTするだけって単にPOSTしただけじゃread.cgiに弾かれる http://medaka.5ch.net/test/read.cgi/php/1036141603/426
427: nobodyさん [sage] 2006/10/14(土) 01:32:50 ID:??? 私はPHPならなんとか作れそうだが、それ以前に2chの仕様を勉強しなくちゃだな。 http://medaka.5ch.net/test/read.cgi/php/1036141603/427
428: nobodyさん [sage] 2006/10/14(土) 01:42:28 ID:??? POST先はbbs.cgiだけどな http://medaka.5ch.net/test/read.cgi/php/1036141603/428
429: nobodyさん [sage] 2006/10/14(土) 02:59:59 ID:??? >>428 それすら知らなかった漏れは百回くらい正規表現の勉強でもしましょうか? http://medaka.5ch.net/test/read.cgi/php/1036141603/429
430: nobodyさん [sage] 2006/10/14(土) 06:34:52 ID:??? >>420 縮めた。 #!/usr/bin/perl use LWP::Simple;use XML::RSS;$r=new XML::RSS;parse$r get$ENV{QUERY_STRING};use CGI":all";%c=%{$r->{channel}};put header,a({href,$c{link}},$c{title}),br,$c{$d= description},br,ul(li[map a({href,$_->{link}},$_->{title}).br.$_->{$d}.br,@{$r ->{items}}]),end_html http://medaka.5ch.net/test/read.cgi/php/1036141603/430
431: nobodyさん [sage] 2006/10/14(土) 14:05:08 ID:??? >>430 sugeeeeeeeeeeeeeeeeeeeeee 問題無く動いた http://medaka.5ch.net/test/read.cgi/php/1036141603/431
432: nobodyさん [sage] 2006/10/14(土) 15:01:38 ID:??? >>430 からもうちょい縮めた上で HTML がまともになるよう追加。 #!/usr/bin/perl use CGI":all";use LWP::Simple;use XML::RSS;$r=new XML::RSS;sub A{a{href,$_[0]-> {link}},$_[0]->{title}}charset$C="UTF-8";parse$r get pop;%c=%{$$r{channel}};put header,start_html(-encoding,$C,lang,ja),h1(A\%c),p($c{$d=description}),ul(li[ map A($_).br.$$_{$d},@{$$r{items}}]),end_html 二行半も空いてるけど付け加える機能を思いつかず。 http://medak
a.5ch.net/test/read.cgi/php/1036141603/432
433: nobodyさん [sage] 2006/10/14(土) 15:13:56 ID:??? >>432 未読管理機能なんかオススメ 二行半でやる方法は思い浮かばないorz むしろ、どういう過程を経て効率的なソースが引けるようになったのかの方に興味あり苦笑 どこか参考にしたサイトとかあります? http://medaka.5ch.net/test/read.cgi/php/1036141603/433
434: nobodyさん [sage] 2006/10/15(日) 11:53:37 ID:??? >>433 > 未読管理機能 ほい。新着タイトルを太字表示。 #!/usr/bin/perl use CGI":all";use LWP::Simple;use XML::RSS;$r=new XML::RSS;dbmopen%n,"7rssrdr", 420;charset$C="UTF-8";sub A{($t,$l)=@$_{"title","link"};a{href,$l},$n{$l}++?$t: b$t}parse$r get pop;%c=%{$$r{channel}};put header,start_html(-encoding,$C,lang, ja),h1(A$_=\%c),p($c{$d=description}),ul(li[map A.br.$$_{$d},@{$$r{items}}]), end_html &
gt; どこか参考にしたサイトとかあります? 駱駝本とか perldoc とか。冗談でも何でもなく。 この遊びのノウハウなら http://cm.xrea.cc/techinfo.cgi に。 http://medaka.5ch.net/test/read.cgi/php/1036141603/434
435: nobodyさん [sage] 2006/10/16(月) 01:39:15 ID:??? >>434 >駱駝本とか perldoc とか。 さもありなんというか結局質の高い基本が一番役にたつんだろうな http://medaka.5ch.net/test/read.cgi/php/1036141603/435
436: aaz [aaz@aaz.com] 2006/11/05(日) 22:18:14 ID:??? http://fitaly.com/board/wordperfect/posts/362.html http://medaka.5ch.net/test/read.cgi/php/1036141603/436
437: nobodyさん [sage] 2007/05/08(火) 22:55:38 ID:??? ほす http://medaka.5ch.net/test/read.cgi/php/1036141603/437
438: nobodyさん [sage] 2007/12/01(土) 02:02:19 ID:??? 月次移動可能なカレンダー。c.phpで保存。 <?php $a=q("Y-m-t","$_GET[y]-1");$d=explode("-",$a);$y="<a href=?y=";$v=$d[0]; $w=$d[1];$z="</tr><tr>";$m="$v-$w";$p=q("Y-m",$w-1,1,$v);$n=q("Y-m",$w+1,1,$v) ;echo"<html>$y$p><</a>$m$y$n>></a> $y c.php>now</a><table border=1><tr>$z";$f= q("w",&quo
t;$m-1");for($i=-6-$f;$i<$d[2]-q("w",$a)+7;$i++){echo($i<1-$f)?"<th>".q( "D",$w,$i,$v)."</th>":(($i<1||$i>$d[2])?"<td></td>":"<td>$i</td>");if(($i+$f)% 7==0)echo$z;}echo"</tr></table></html>";function q($x,$w,$i=0,$v=0){return($i) ?date($x,mktime(0,0,0,$w,$i,$v)):date($x,strtotime($w));}?> http://medaka.5ch.net/test/read.cgi/php/1036141603/438
439: nobodyさん [sage] 2007/12/06(木) 09:44:33 ID:??? >>438 「now」も要らんと思う。 <?php list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));$f=q("$v-$w-1","w" );echo$l="<a href=?y=",q($w-1,"Y-m",1,$v),"><</a>$v-$w$l",q($w+1,"Y-m",1,$v) ,">></a> $l>now</a><table><tr>";for($i=-6-$f;$i<$d-q($a,"w")+7;){echo$i<1-$f ?"<th>&q
uot;.q($w,"D",$i,$v)."</th>":"<td>".(($i<1||$i>$d)?"":$i)."</td>";if(($i++ + $f)%7==0)echo"</tr><tr>";}function q($w,$x,$i=0,$v=0){return date($x,$i?mktime( 0,0,0,$w,$i,$v):strtotime($w));}?></tr></table> PHPは不得手なんで、これよりもっと縮む筈。 http://medaka.5ch.net/test/read.cgi/php/1036141603/439
440: 438 [sage] 2007/12/08(土) 01:17:01 ID:??? >>439 凄いですね。いろんなことができるんだ、と感心しきり。 少しだけ縮めた。 <?php list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));$f=q("$v-$w-1","w" );echo$l="<a href=?y=",q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a><table><tr>";for($i=-6-$f;$i<$d-q($a,"w")+7;){ec
ho$i<1-$f?"<th>".q($w ,"D",$i)."</th>":"<td>".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr ><tr>";}function q($w,$x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v ):strtotime($w));}?></tr></table> http://medaka.5ch.net/test/read.cgi/php/1036141603/440
441: 438 [sage] 2007/12/08(土) 02:02:58 ID:??? 手抜きバージョン。取り合えず表示されるみたいなので… <?php function q($w,$x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v): strtotime($w));}list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));echo$l=" <a href=?y=",q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a> <table><tr>";for($i=-6-$f=q("$v-$w
-1","w");$i<32;){echo$i<1-$f?"<th>".q($w,"D", $i)."</th>":"<td>".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr><tr> ";}?></tr></table> http://medaka.5ch.net/test/read.cgi/php/1036141603/441
442: 438 [sage] 2007/12/08(土) 02:37:04 ID:??? HTMLダメダメの超手抜きバージョン。無理やり5行にしてみた。 <?php list($v,$w,$d)=explode("-",q("$_GET[y]-1","Y-m-t"));echo$l="<a href=?y=", q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a><table>";for( $i=-6-$f=q("$v-$w-1","w");$i<32;){echo$i<1-$f?"<th>".q($w,"D",$i).&
quot;</th>":"<td> ".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr><tr>";}function q($w, $x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v):strtotime($w));}?> http://medaka.5ch.net/test/read.cgi/php/1036141603/442
443: nobodyさん [sage] 2007/12/08(土) 22:33:30 ID:??? 閉じタグ無しでいいなら <?php function q($w,$i=1,$x="Y-m"){global$v;return date($x,$i?mktime(0,0,0,$w, $i,$v):strtotime($w));}list($v,$w,$d)=explode("-",q("$_GET[y]-1",0,"Y-m-t")); echo$l="<a href=?y=",q($w-1),"><</a>$v-$w$l",q($w+1),">></a> $l>now</a><table>" ;for($i=-6-$f=q("$v-$w-1",0,"w");$i<32;){echo"<td&
gt;",($i<1-$f?q($w,$i,"D"):($i<1 ||$i>$d?"":$i)),($f+$i++)%7?"":"<tr>";} http://medaka.5ch.net/test/read.cgi/php/1036141603/443
444: nobodyさん [円柱都市age] 2008/02/14(木) 04:21:18 ID:??? >>334 3年越しの7clap. #!/usr/bin/perl use CGI":all";charset$c=Shift_JIS;sub d{($m,$m,$h,$d,$m,$y)=localtime(time-pop); $l[0]=(190001+$y*100+$m)*100+$d}param(K,$k=1+param K);($w=escapeHTML(param W))=~ y/\0- / /s;($C,$M,$L,$E,@M)=<DATA>;open L;flock L,2;open C;@l=d>(@c=<C>)[-1]?(d, (0)x25,$/):split/<>/,pop@c;@c<14||shift@c;$l[$_]++for$h+2,1;open C,">$C";print C @c,join"<>",@l;d 1209600;open M;@m=grep$l[0]<
;=$_,<M>;open M,">$M";print M@m,""ne $w&&d."<>$h<>$w<>\n";put header,start_html(-encoding,$c,lang,ja),$k<10?($M[rand@ M],startform,p(hidden(K),Comment,textfield(W),submit Clap),endform):p$E,end_html __DATA__ log.dat mes.dat >lock.dat 沢山の拍手を有り難うございました! 拍手が送信されました。ありがとうございました! 拍手が送信されました。ありがとうございますた! 拍手が送信されました。ありがとさ〜ん! ・flock非保護。 http://medaka.5ch.net/test/read.cgi/php/1036141603/4
44
445: nobodyさん [ルルイエage] 2008/02/16(土) 22:06:19 ID:??? >>327 7kaiseki.cgi #!/usr/bin/perl use CGI":all";charset$c=Shift_JIS;($P,$C,$M)=<DATA>;($p=param P).$/ne$P&¨sub l{(sort@_)[-1]/10||1}sub d{@p=localtime time-86400*pop;$g=(190001+$p[5]*100+$p[4 ])*100+$p[3]}open C;%c=map{/<>/;$`,$'}<C>;($l,@l)=$c{$q=param(T)||d}=~/\d+/g;put header,start_html(-encoding,$c,lang,ja),h1($q),table((map{Tr td[$z++.':00',$_+0, "/"x($_/l@l)]}@l[0..23]),Tr td[Total,$l+0,""]),h1(Mes),dl(map{s/&l
t;>$//;/<>/;$`!=$ z&&dt($z=$`.':00'),dd$'}grep{s/$q<>//}open(M),<M>),h1(Past14day),table(map{Tr td [a({href,"?P=$p&T=".d$x++},$g),$_,"/"x($_/l@s)]}@s=map{$c{d$_}+0}0..13),end_html __DATA__ password log.dat mes.dat ・HTML適当。 ・ファイルロックなし。 ・DATAの1行目にパスワードを設定、「?P=password」でリクエスト。 http://medaka.5ch.net/test/read.cgi/php/1036141603/445
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 7 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.009s