Jump to content

Recommended Posts

Posted (edited)

I want to delete the similar data after cycle.

#include <array.au3>
#include <String.au3>

_deletesimilar()

Func _deletesimilar()
    $aReadSmilar = _HttpGet("https://duplicatesimilartest.blogspot.com")
    For $var = 1 To 10 Step 1
        $aBetween = _StringBetween($aReadSmilar, '<p>', '</p>')
        If IsArray($aBetween) Then
            $aUniques = _ArrayUnique($aBetween)
            For $i = 1 To UBound($aUniques) - 1
                ConsoleWrite($aUniques[$i] & @CRLF)
            Next
        EndIf
    Next
EndFunc   ;==>_deletesimilar

Func _HttpGet($Url)
    Local $oHTTP = ObjCreate("Microsoft.XMLHTTP")
    $oHTTP.Open("GET", $Url, False)
    $oHTTP.Send()
    If @error Then
        $error = 1
        $oHTTP = 0
        Return SetError(1)
    EndIf
    If $oHTTP.Status = 200 Then
        Local $sReceived = $oHTTP.ResponseText
        $oHTTP = Null
        Return $sReceived
    EndIf
    $oHTTP = Null
    Return -1
EndFunc   ;==>_HttpGet

 

Spoiler

Em2ZgZ.png

 

Edited by youtuber
Posted
14 minutes ago, Nine said:

 And I don't understand why you need to repeat 10 times the same code.

Func _deletesimilar()
    For $var = 1 To 10 Step 1
        $aReadSmilar = _HttpGet("https://duplicatesimilartest.blogspot.com/p/" & $var & ".html")
        $aBetween = _StringBetween($aReadSmilar, '<p>', '</p>')
        If IsArray($aBetween) Then
            $aUniques = _ArrayUnique($aBetween)
            For $i = 1 To UBound($aUniques) - 1
                ConsoleWrite($aUniques[$i] & @CRLF)
            Next
        EndIf
    Next
EndFunc

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...