Computers Problems and Solutions

Windows, Internet, Programming

Archive for the ‘AutoIt’ Category

Free MySpace search tool by a Freelancer

Posted by zlatipln on September 24, 2008

I am tired doing programs for a freelance site and not choosing me.

Instead of it, I will publish here for free download some of my programs – most of them are ebay, myspace tools, scrappers and data mining. Also have forum posters, translators-dictionary, and all the Internet stuff that can be automated.

If you have ideas, questions or found bugs – please leave a short comment to let me know.

Soon will start my Autoit tutorial also.

The first program I want to give out for free is MySpace search tool: http://craigmaster.freehostia.com/MsTool.rar

No need to install – just run and type your search words, space separated:

for example: Seattle T-mobile phone, or  Clay Aiken, Dallas yoga or Ohio Google phone or California restaurant or Vegas casino, etc.

Wait program to do the search. Three files are created : the “ms.csv” – results and two temp files – you can delete them.

To terminate program use ESC.

At the end there are all friendIDs found for your search /clay aiken in example./

Soon will post second program which uses that friendID to extract more data from user profiles, even theyr MySpace layout.

Here is the source:

#include<ie.au3>
#include<inet.au3>
#include<array.au3>
#include<file.au3>
Dim $a, $aa
HotKeySet(“{ESC}”, “Terminate”)
$f = FileOpen(‘ms.csv’, 2)
$search0 = InputBox(“searcg box”, “Please type the search words separated by space”)
$search = StringReplace($search0, ‘ ‘, ‘%20′)
$u = “http://searchservice.myspace.com/index.cfm?fuseaction=sitesearch.results&qry=” & $search & “&type=AllMySpace”
InetGet($u, ‘temp.txt’)
_FileReadToArray(‘temp.txt’, $a)
For $ar = 100 To 300
 If StringInStr($a[$ar], ‘ results for’) Then
  $br = SttringBetween($a[$ar], ’span>’, ‘ results for’)
  ;ConsoleWrite($br & @CR)
  ExitLoop
 EndIf
Next
$br = StringReplace($br, ‘,’, ”)
$br = StringReplace($br, ‘of’, ”)
$br = StringReplace($br, ‘ ‘, ”)
FileWriteLine($f, ‘Found:’ & $br & ‘ results for ‘ & $search0)
$br = Number($br)
For $i = 1 To round($br/10)
 HotKeySet(“{ESC}”, “Terminate”) 
 $u1 = “http://searchservice.myspace.com/index.cfm?fuseaction=sitesearch.results&qry=” & $search & “&type=AllMySpace&searchid=f6309e4f-39f2-43c6-9b59-5adef4eaa395&pg=” & $i
 InetGet($u1, ‘temp1.txt’)
 _FileReadToArray(‘temp1.txt’, $aa)
 $lines =$aa[0]
 $rold=”
 For $j = 100 To $lines
  HotKeySet(“{ESC}”, “Terminate”)
  If StringInStr($aa[$j], ‘friendid=’) Then
   $r = SttringBetween($aa[$j], ‘friendid=’, ‘”‘)
   if $r=$rold then continueloop
   if stringlen($r)<9 then
   FileWriteLine($f, $r)
      EndIf
   $rold=$r
  EndIf
 Next
Next
MsgBox(0, ‘READY!’, ‘You can see results in ms.csv file’)
FileClose($f)

Func Terminate()
 FileClose($f)
 Exit 0
EndFunc   ;==>Terminate

Func SttringBetween($s, $from, $to)
 $x = StringInStr($s, $from) + StringLen($from)
 $y = StringInStr(StringTrimLeft($s, $x), $to)
 Return StringMid($s, $x, $y)
EndFunc   ;==>SttringBetween

===========================================================

In next post I will upload source code file in .Au3 format /Autoit/ with comments.

You will be able to compile it, change it and add more features.

Posted in AutoIt, Programming, Software, myspace | Tagged: , , , , , , , , , , , | 3 Comments »