Comment detail

LL Golf Hole 1 - tinyurl.comを使ってURLを短縮する (Nested Flatten)
1
2
3
4
5
6
7
8
9
private import std.stdio, std.string, std.socket, std.socketstream;

void main() {
    auto s = new SocketStream(new TcpSocket(new InternetAddress("tinyurl.com", 80)));
    scope(exit) s.close;
    
    s.writeString("GET /api-create.php?url=http://ll.jus.or.jp/2008/info/xgihyo HTTP/1.1\r\nHost: tinyurl.com\r\n\r\n");
    foreach(char[] line; s) if(line.startsWith("http://")) writeln(line);
}

Index

Feed

Other

Link

Pathtraq

loading...