Crawl Web forum email Address section of the code

Source: Internet
Author: User
Tags chr mail

Crawl Web forum Email Address section of the code

/**

Author: Ci Qin Qiang

Email: cqq1978@gmail.com

Http://blog.csdn.net/cqq

**/


Recently, has been thinking about how to publicize our new website,http://www.up114.com .

Search engine optimization is naturally the first choice, but also can not miss the bulk of the mail, although the bulk of the mail by people despise,

However, as long as the selected group of objects, less hair point, should be nothing,: = ——。


So I found some related topics of the forum, many are moving the network forum, now is the need to put the Forum users email address

Collected, online also sell a special tool, but today we have to write a small tool, the same can achieve results.


Code as follows, with Notepad and other text editing tools, save into Dv.vbs

Before using, you need to go to that forum, register a user and log in


How to use: C:\cscript dv.vbs on it.


' Save location for the email address collected

strfile = "D:\email.txt"

Srturl = "http://bbs.aaa.com"

IStart = 1 ' User ID min value

iend = 1000 ' User ID maximum

For I=istart to Iend


STRURL1 = strURL & "/dispuser.asp?id=" & CStr (i)

strret = OpenURL (STRURL1)

strret = Getmid (Strret, "mailto:", ">") ' This place may need to be flexible to make some changes

If I mod 100=0 then
Call WriteToFile (Strfile,stra)
Stra = ""
Else
If strret<> "" Then Stra = stra & strret & VbCrLf
End If

WScript.Echo I & VbTab & strret

Next


Sub WriteToFile (STRFILE,STR)
Dim FSO, F
Set fso = CreateObject ("Scripting.FileSystemObject")
Set f = fso. OpenTextFile (strfile, 8, True)
F.write Str
Set f= Nothing
Set fso=nothing
End Sub


Function Bytes2bstr (vIn)
Dim I
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = AscB (MidB (vin,i,1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vin,i+1,1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function


Function OpenURL (strURL)

On Error Resume Next

Set xmlhttp = CreateObject ("Microsoft.XMLHTTP")
Xmlhttp.open "Get", (strURL), False
Xmlhttp.send
Openurl=bytes2bstr (XMLHTTP. Responsebody)

Set xmlhttp = Nothing
End Function

Function getmid (str, STR1, STR2)
Dim I
Dim J
Str11 = ""
i = InStr (str, STR1)
If i > 0 Then
j = InStr (i, str, str2)
If J > 0 Then
Str11 = Mid (str, i + len (str1), J-i-Len (str1))
End If
End If
Getmid = Str11
End Function



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.