Changeset 25821

Show
Ignore:
Timestamp:
12/04/08 11:10:53 (5 weeks ago)
Author:
takeshik
Message:

Twitter 構造変更へのアプローチを若干強靱?に

Location:
lang/vb2005/Tween/Tween
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/Tween/AnalyzeKey.vb

    r25818 r25821  
    22    '    このファイルはデバッグビルドのTweenにより自動作成されました   作成日時  2008/10/18 2:06:36 
    33 
    4     Public _splitPost As String = "<tr class=""hentry status reply"" id=""status_" 
    5     Public _splitPostRecent As String = "<tr class=""hentry status"" id=""status_" 
     4    Public _splitPost As String = "<tr id=""status_" 
     5    Public _splitPostRecent As String = "<tr id=""status_" 
    66    Public _statusIdTo As String = """" 
    7     Public _splitDM As String = "<tr id=""status_" 
     7    Public _splitDM As String = "<tr id=""direct_message_" 
    88    Public _parseName As String = "://twitter.com/" 
    99    Public _parseNameTo As String = """" 
  • lang/vb2005/Tween/Tween/Twitter.vb

    r25819 r25821  
    232232        End If 
    233233 
     234        ' tr 要素の class 属性を消去 
     235        Do 
     236            Dim idx As Integer = retMsg.IndexOf("<tr class=""") 
     237            If idx = -1 Then Exit Do 
     238            retMsg = retMsg.Remove(idx + 4, retMsg.IndexOf("""", idx + 11 + 1) - idx - 2) ' 11 = "<tr class=""".Length 
     239        Loop 
     240 
    234241        If _endingFlag Then Return "" 
    235242 
     
    250257            strSepTmp = _splitPost 
    251258        End If 
    252         '''''''''''''''''''''''''''''' 
    253         strSepTmp = "<tr class=""hentry status" 
    254         ''''''''''''''''''''''''''''''' 
     259 
    255260        pos1 = retMsg.IndexOf(strSepTmp) 
    256261        If pos1 = -1 Then 
     
    316321                Try 
    317322                    'Get ID 
    318                     'pos1 = 0 
    319                     pos1 = strPost.IndexOf("id=""status_", 0) 
    320                     pos2 = strPost.IndexOf(_statusIdTo, pos1 + 11) 
    321  
    322                     lItem.Id = HttpUtility.HtmlDecode(strPost.Substring(pos1 + 11, pos2 - pos1 - 11)) 
     323                    pos1 = 0 
     324                    pos2 = strPost.IndexOf(_statusIdTo, 0) 
     325                    lItem.Id = HttpUtility.HtmlDecode(strPost.Substring(0, pos2)) 
    323326                Catch ex As Exception 
    324327                    _signed = False 
     
    634637            retMsg = DirectCast(_mySock.GetWebResponse("https://" + _hubServer + _DMPathSnt + pageQuery, resStatus), String) 
    635638        End If 
     639 
     640        ' tr 要素の class 属性を消去 
     641        Do 
     642            Dim idx As Integer = retMsg.IndexOf("<tr class=""") 
     643            If idx = -1 Then Exit Do 
     644            retMsg = retMsg.Remove(idx + 4, retMsg.IndexOf("""", idx + 11 + 1) - idx - 2) ' 11 = "<tr class=""".Length 
     645        Loop 
     646 
    636647        If retMsg.Length = 0 Then 
    637648            _signed = False 
     
    676687 
    677688        '各メッセージに分割可能か? 
    678         _splitDM = "<tr class=""hentry direct_message" 
    679689        pos1 = retMsg.IndexOf(_splitDM) 
    680690        If pos1 = -1 Then 
     
    701711                'Get ID 
    702712                Try 
    703                     'pos1 = 0 
    704                     pos1 = strPost.IndexOf("id=""direct_message_", 0) 
    705                     pos2 = strPost.IndexOf("""", pos1 + 19) 
    706                     lItem.Id = HttpUtility.HtmlDecode(strPost.Substring(pos1 + 19, pos2 - pos1 - 19)) 
     713                    pos1 = 0 
     714                    pos2 = strPost.IndexOf("""", 0) 
     715                    lItem.Id = HttpUtility.HtmlDecode(strPost.Substring(0, pos2)) 
    707716                Catch ex As Exception 
    708717                    _signed = False