Sub aa()
Debug.Print "sub autore()"
Debug.Print "With CreateObject(""winhttp.winhttprequest.5.1"")"
For i = 1 To UsedRange.Rows.Count
If i = 1 Then
Debug.Print Replace(Replace(Replace(Replace(Cells(i, 1), "curl ", "url="), """", """"""), "'", """"), " \", "")
If InStr(1, Cells(i, 1), "get") Then
Debug.Print ".Open ""get"",url"
Else
Debug.Print ".Open ""post"",url"
End If
ElseIf Left(Cells(i, 1), 6) = " -H '" Then
If InStr(1, Cells(i, 1), "cookie") Then
Cells(i, 2) = Replace(Split(Cells(i, 1), ": ", 2, 0)(1), "' \", "")
Debug.Print ".setRequestHeader ""cookie"",Cells(" & i & ", 2)"
Else
If InStr(1, Cells(i, 1), ": ") Then
Debug.Print Replace(Replace(".setRequestHeader """ + Split(Cells(i, 1), ": ", 2, 0)(0) + """,""" + Replace(Split(Cells(i, 1), ": ", 2, 0)(1), """", """""") + """", " -H '", ""), "' \", "")
End If
End If
Else
If InStr(1, Cells(i, 1), "'") Then
Cells(i, 2) = Replace(Split(Cells(i, 1), "'", 2, 0)(1), "' \", "")
Debug.Print "data=cells(" & i & ",2)"
End If
End If
Next
Debug.Print ".send (data)"
Debug.Print "str1=.responsetext"
Debug.Print "end with"
Debug.Print "Open ""d:\1.txt"" For Output As #1"
Debug.Print "Print #1, str1"
Debug.Print "Close #1"
Debug.Print "end sub"
End Sub |