Skip to content

Instantly share code, notes, and snippets.

Sub Main()
Dim t = Task.Factory.StartNew(
Async Function()
Dim msg = GetMessage()
Await Tweet(msg)
End Function).Unwrap
Try
t.Wait()
Private Function GetMessage() As String
Dim items = New List(Of String)
Dim d = XDocument.Load("http://pronama.azurewebsites.net/feed/")
For Each i In d...<item>
Dim msg = String.Format("old post: {0} {1}", i.<title>.Value, i.<guid>.Value)
items.Add(msg)
Next
Dim r = New Random
Dim items = New List(Of String)
Dim d = XDocument.Load("http://pronama.azurewebsites.net/feed/")
For Each i In d...<item>
Dim msg = String.Format("old post: {0} {1}", i.<title>.Value, i.<guid>.Value)
items.Add(msg)
Next
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" ... >
<channel>
...
<item>
<title>[Web Comic] 情報処理研究会漫画 すぱこー Ver. 14</title>
<link>http://pronama.azurewebsites.net/2014/07/22/web-comic-spaco-14/</link>
<comments>http://pronama.azurewebsites.net/2014/07/22/web-comic-spaco-14/#comments</comments>
<pubDate>Tue, 22 Jul 2014 13:50:22 +0000</pubDate>
<dc:creator><![CDATA[jz5]]></dc:creator>
$ patch -p0 < patch_sl_pronama.patch
$ cd sl
$ make
cc -O -o sl sl.c -lcurses -ltermcap
$ mv sl /usr/local/bin/
$ apt-get install patch
$ apt-get install make
$ apt-get install gcc
$ apt-get install libncurses5-dev
$ wget "http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/sl/sl.tar"
$ tar xvf sl.tar
$ wget "http://downloads.bonprosoft.com/file/patch/patch_sl_pronama.patch"
body, table, form, input, td, th, p, textarea, select {
font-family: "メイリオ","Meiryo","ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro","MS Pゴシック", "MS P Gothic","Osaka",
Verdana,Arial, Helvetica, sans-serif;
}
#main-table {
background-image: url(/images/pronama-chan.png) !important;
}
@jz5
jz5 / Module.vb
Last active August 29, 2015 14:03
Sub Main()
Dim t = Task.Factory.StartNew(
Async Function()
Dim auth = CreateSingleUserAuthorizer()
Await auth.AuthorizeAsync
Using ctx = New TwitterContext(auth)
Await ctx.TweetAsync("こんにちは")
End Using
@jz5
jz5 / Module.vb
Last active August 29, 2015 14:03
' Imports LinqToTwitter を追加しておく
' Twitter 認証に使うオブジェクトを返す
Private Function CreateSingleUserAuthorizer() As SingleUserAuthorizer
Dim s = System.Configuration.ConfigurationManager.AppSettings
Dim auth = New SingleUserAuthorizer With {
.CredentialStore = New SingleUserInMemoryCredentialStore With
{
.ConsumerKey = s("ConsumerKey"),