コンテンツにスキップ

利用者:Was a bee/Huggle

カスタム・ハグルの変更履歴(Custom Huggle: Change log)

ダウンロードはこちら→ Wikipedia:Huggle/Download

バージョン Ver. 0.9.11_ja_005

[編集]

2010/11/03 公開(released)

報告機能 Report function

[編集]
' 報告機能が英語版、ドイツ語版、スペイン語版のみでしか動作しない仕様になっていた
' 条件分岐の二箇所に日本語版を追加。これも本来はプロジェクト設定を通して、設定できるようになるべき・・しかし
' Reporting function worked only in en.wiki, de.wiki and es.wiki. Add there ja.wiki at two lines.
' This also should be configuable through project setting. But, yes, such fixation is not easy. 
' This is ad-hoc solution.
' ReportRequest.vb -> Class VandalReportRequest

            'Check for existing report
            Select Case Config.Project
                Case "en.wikipedia", "ja.wikipedia"

            'Report user
            Select Case Config.Project
                Case "en.wikipedia", "ja.wikipedia"

バージョン Ver. 0.9.8_ja_004

[編集]

2010/10/31 公開(released)

Substring関数の修正 (fixing substring function)

[編集]
' 何文字目以降を切り出す、というSubstring関数で、「英語版における各名前空間の名称」の文字数を前提として
' 固定値で Substring(7) といった使われ方をしていたが、この部分は起動中にエラーを起こしていた。
' In some part, Substring() functions are used with fixed argument (e.g Substring(7))
' But this type of fixed argument is only compatible with english wikipedia.
' 次のような形で他の言語版で動くよう修正 fixed such argument as follows.
' xx.Substring(7) -> xx.Substring(xx.IndexOf(":")+1)

'At Process.vb -> ProcessNewEdit() -> Dim PageOwner 
Edit.Page.Name.Substring(7) -> Edit.Page.Name.Substring(Edit.Page.Name.IndexOf(":")+1)

特別ページのローカライズ (Localization of namespace "Special")

[編集]
'Special namespace localizasion

' add one line at Project Setting [[Wikipedia:Huggle/Config]]
			namespace-special:特別

' add one line to ConfigIO.vb -> SetProjectConfigOption()
            Case "namespace-names" : Space.Special.Add(Value)

'Space.Special(Space.Special.Count - 1) returns "Special" if no project setting exist,
'or it returns, for example, "特別", if project setting "namespace-special:特別" exist at [[Wikipedia:Huggle/Config]]

IRC読み取りの正規表現の一部修正 (Fixed regex pattern for irc-RC)

[編集]
'IRCの読み取りが、英語版のみを対象とした正規表現になっていたのを日本語版向けに修正。
'しかし当然だけれどもこの修正によって、逆に英語版では動作しなくなる。あまり良い直し方ではない。
'理想的には正規表現を変数化して、プロジェクトごとに設定できるようにするのが良い。ただそれはややこしい。
'Regex analysis of irc-RC is compatible withe only english wikipedia.
'Some part of it is fixed for Japanese irc-RC. This makes this custom Huggle imcompatible with english wikipedia.
'This fixing is not good style. Ideally, regex pattern should be configurable through project setting.
' Irc.vb -> Dim
' Regex pattern for blocking
    Dim BlockMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07特別:Log/block�14\]\]�4 block" & _
        "�10 �02� �5\*� �03([^�]*)� �5\*�  �10\[\[�02利用者:([^�]*?)�10\]\] を([^ブ]*)ブロックしました \(([^\)]*)\): " & _
        "([^�]*?)�", RegexOptions.Compiled)

' Regex pattern for deletion
    Dim DeleteMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07特別:Log/delete�14\]\]�4 delete" & _
        "�10 �02� �5\*� �03([^�]*)� �5\*�  �10「\[\[�02([^�]*)�10\]\]」を削除しました(?:: ([^�]*))?�", _
        RegexOptions.Compiled)

' Regex pattern for moving
    Dim MoveMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07特別:Log/move" & _
        "�14\]\]�4 move(?:_redir)?�10 �02� �5\*� �03([^�]*?)� �5\*�  �10「\[\[�02([^�]*?)�10\]\]」を(?:このページあてのリダイレクト)?「" & _
        "\[\[([^\]]*)\]\]」へ移動(: ([^�]*))?�", RegexOptions.Compiled)

' Regex pattern for new account
    Dim NewUserMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07特別:Log/newusers" & _
        "�14\]\]�4 create�10 �02� �5\*� �03([^�]*?)� �5\*�  �10新規利用者�", RegexOptions.Compiled)

' Regex pattern for page protection
    Dim ProtectMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07特別:Log/protect" & _
       "�14\]\]�4 protect�10 �02� �5\*� �03([^�]*)� �5\*�  �10「\[\[�02([^�]*?)�10\]\]」を保護しました。" & _
       "(?: \[edit=([a-z]*)\] \((無期限|[^に]*)(?:に解除)?\))?" & _
       "(?: \[move=([a-z]*)\] \((無期限|[^に]*)(?:に解除)?\))?" & _
       "(?: \[create=([a-z]*)\] \((無期限|[^に]*)(?:に解除)?\))?(?:: ([^�]*))?�?", _
        RegexOptions.Compiled)

バージョン Ver. 0.9.8_ja_003

[編集]

2010/10/30 公開(released)

新規作成ページの誤判定修正 (fixing new page detection)

[編集]
' IRCでの新規ページのマークには「N」と「!N」があるが、前者にしか対応してなかったため、
' 記事空間の新規作成などが表示されなてなかった。正規表現に!?を加えて修正。
' In irc stream, there two type of mark for new page.
' One is "N", and the other is "!N"
' regex pattern was only treat "N". So part of new page was not shown up in queue.
' Fixing regex as follws (just adding !?) at irc.vb -> Dim NewPageMatch

    Dim NewPageMatch As New Regex("rc-pmtpa!~rc-pmtpa@[^ ]* PRIVMSG #[^:]*:�14\[\[�07([^�]*)�14\]\]�4 !?N(M?)(B?)" & _
        "�10 �02[^ ]* �5\*� �03([^�]*)� �5\*� \(([^\)]*)\) �10([^�]*)�", RegexOptions.Compiled)

バージョン Ver. 0.9.8_ja_002

[編集]

2010/10/29 公開(released)

警告レベルの判定 (detecting warning level at user-talk page in Japanese wikis)

[編集]
'各利用者の警告レベルの判定ができなかったのをコードを付加して補完。
'Style of signature at JAWP is different from English's one.
'Canonical signature styel in JAWP is as follows
'[[利用者:Name]] yyyy年mm月dd日 (D) (UTC)
'利用者 = User, y = year, m = month, d = day, D = Sunday, Monday...
'For processing this, add one section to Processing.vb -> ProcessUserTalk()

		'For Japanese wikis: Find standard warnings and signature
        For Each Item As Match In Regex.Matches(Text, _
            "<!-- Template:[Uu]w-([a-z]*)(\d)?(im)?(?:}})? -->.*\[\[(User|利用者)(?: talk)?:([^|]*).*(\d{4}年\d+月\d+日 " & _
            "\(.\) \d{2}:\d{2}) \(UTC\)", RegexOptions.Compiled)

            Dim NewWarning As New Warning
            NewWarning.Time = Date.SpecifyKind(CDate(Item.Groups(6).Value), DateTimeKind.Utc)
            If NewWarning.Time.AddHours(Config.WarningAge) > Date.UtcNow Then RecentWarnings += 1
            If Item.Groups(5).Value <> "" Then NewWarning.User = GetUser(Item.Groups(5).Value)

            NewWarning.Type = Item.Groups(1).Value
            If NewWarning.Type = "cluebotwarning" Then NewWarning.Type = "bot"

            Select Case Item.Groups(2).Value
                Case "1" : NewWarning.Level = UserLevel.Warn1
                Case "2" : NewWarning.Level = UserLevel.Warn2
                Case "3" : NewWarning.Level = UserLevel.Warn3
                Case "4" : NewWarning.Level = UserLevel.WarnFinal
                Case Else : If Item.Groups(1).Value = "bv" Then NewWarning.Level = UserLevel.WarnFinal _
                    Else NewWarning.Level = UserLevel.Warning
            End Select

            If Item.Groups(1).Value.Contains("block") Then NewWarning.Level = UserLevel.Blocked

            Warnings.Add(NewWarning)
        Next Item

バージョン Ver. 0.9.8_ja_001

[編集]

2010/10/26 公開(released)

言語設定を追加(Add New language Setting)

[編集]
'日本語の場合の例 This is example of Japanese language
'一行追加 add one line at "ConfigIO -> LoadLanguages()"
LoadLanguage("ja", My.Resources.ja)

'ファイルを一つ追加 add file through "My Project -> Resources.resx -> File"
ja.txt

プロジェクト設定を追加(Add new project on login selecter)

[編集]
'日本語版の場合の例 This is example of Japanese Wikipedia
'一行追加 add one line at DefaultLocalConfig.txt
ja.wikipedia;http://ja.wikipedia.org/,

ヘルプとフィードバックのURLを変更(Make Help URL & Feedback URL Configurable by Project Setting)

[編集]
'二行追加 add two linse at "ConfigIO.vb -> SetSharedConfigOption()" 
'設定がなければグローバル設定が使用される This is compatible with global setting. 
'If no project setting exists, global setting is used.
Case "docslocation" : Config.DocsLocation = Value
Case "feedbacklocation" : Config.FeedbackLocation = Value

言語とプロジェクトのデフォルト設定を変更(Set your lang and your project as Default)

[編集]
'''日本語と日本語版の場合 This is example of Japanese language and Japanese Wikipedia
'''設定を変える change setting at DefaultLocalConfig.txt
project:ja.wikipedia

'''change setting at Config.vb
Public DefaultLanguage As String = "ja"