Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Created January 18, 2013 12:25
Show Gist options
  • Save azyobuzin/4564274 to your computer and use it in GitHub Desktop.
Save azyobuzin/4564274 to your computer and use it in GitHub Desktop.
キルミーベイベーアイコンダウンローダー
using System;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
namespace KillmebabyIconDownloader
{
class Program
{
static void Main(string[] args)
{
var baseUri = new Uri("http://killmebaby.tv/special_icon.html");
using (var wc = new WebClient())
{
var response = wc.DownloadString(baseUri);
var images = Regex.Matches(response, @"<td><img src=""(images/icon/icon/(\d\d_\d\d\d\.png))"" width=""128"" height=""128""></td>")
.Cast<Match>()
.Select(m => Tuple.Create(new Uri(baseUri, m.Groups[1].ToString()), m.Groups[2].ToString()));
foreach (var img in images)
{
Console.WriteLine(img.Item1);
wc.DownloadFile(img.Item1, img.Item2);
}
}
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment