Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FACEBOOK FRIEND'S LIST
#1
I would like to save my facebook friend's list to notepad and I having a difficult doing so. What I need is for QM to through the entire list, get the name and the corresponding html link showing up in the Status bar and saved them somehow into notepad using commas as separator.

I am attaching a picture as an example. When the macro finishes, the following should be listed on notepad:

FRIEND ONE, http://www.facebook.com/friend.one
FRIEND TWO, http://www.facebook.com/friend.two
FRIEND THREE, http://www.facebook.com/friend.three


Any ideas on how I can get started? This is pretty advance for me.

Thanks so much
Liza


Attached Files Image(s)
   
#2
Macro Macro1545
Code:
Copy      Help
HtmlDoc d.InitFromInternetExplorer(win("" "IEFrame"))
ARRAY(MSHTML.IHTMLElement) a
d.GetLinks(a)
int i
str su sa sn
for i 0 a.len
,su=a[i].getAttribute("href" 2)
,if(!su.beg("/profile.php?id=")) continue
,sn=a[i].innerText
,if(!sn.len) continue ;;image
,sa.formata("%s, http://www.facebook.com%s[]" sn su)

str sf="$desktop$\facebook friends.txt"
sa.setfile(sf)
run sf
#3
Hello Sir, the codes did not work. It opened the text file but it's empty and opened another IE window:

about:blank#%2FLIZA%3Fsk%3Dfriends%26v%3Dfriends

Liza
#4
Try this.

Macro Macro1545
Code:
Copy      Help
MSHTML.IHTMLDocument2 d=htm(win("" "IEFrame"))
MSHTML.IHTMLElement e
str su sa sn
foreach e d.links
,su=e.getAttribute("href" 2)
,if(!su.beg("/profile.php?id=")) continue
,sn=e.innerText
,if(!sn.len) continue ;;image
,sa.formata("%s, http://www.facebook.com%s[]" sn su)

str sf="$desktop$\facebook friends.txt"
sa.setfile(sf)
run sf
#5
Still the same, text file is blank but no additional IE window opened.

Liza
#6
Macro facebook friends
Code:
Copy      Help
MSHTML.IHTMLDocument2 d=htm(win("" "IEFrame"))
MSHTML.IHTMLElement e
str su sa sn
foreach e d.links
,su=e.getAttribute("href" 2)
,out su ;;this line displays link URL in QM output. It displays all links, not only friends. Edit the following code so that it would get URLs that you need.
,if(!su.beg("/profile.php?id=")) continue
,sn=e.innerText
,if(!sn.len) continue ;;image
,sa.formata("%s, http://www.facebook.com%s[]" sn su)

str sf="$desktop$\facebook friends.txt"
sa.setfile(sf)
;run sf ;;later uncomment this
#7
Thank you so much, this is a great start.

I am getting a double entry though. I believe it is because of the picture and the name link. Is it not possible to get the actual friend's name?

Thank you
Liza
#8
My code gets link text into variable sn.
For image it is empty. This code skips images: if(!sn.len) continue ;;image
Otherwise it is friend name.
#9
Yes, I figured that one out :lol: . Everything is working great.

Thank you so much
Liza
#10
Is it possible to use this on Firefox instead?
#11
Try FirefoxGetLinks
extract links (a href => zip only)


Forum Jump:


Users browsing this thread: 1 Guest(s)