Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace FBComments
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string link = "https://www.facebook.com/groups/";
- webBrowser1.Navigate(link + textBox1.Text + "/members/");
- timer1.Start();
- }
- public bool HHH = true;
- public List<string> IDs = new List<string>();
- private void timer1_Tick(object sender, EventArgs e)
- {
- try
- {
- if (HHH)
- {
- var links = webBrowser1.Document.GetElementsByTagName("div");
- foreach (HtmlElement link in links)
- {
- if (link.GetAttribute("className") == "clearfix _60rh _gse")
- {
- var Name = link.OuterHtml.Split(new[] { "aria-label" }, StringSplitOptions.None)[1];
- var href = link.OuterHtml.Split(new[] { "id" }, StringSplitOptions.None)[1];
- var GetIdPost = href.Split(new[] { "page_members_", "recently_joined_", "local_members_", "self_bio_", "admins_moderators_", "friends_", "things_in_common_" }, StringSplitOptions.None)[1];
- string IDPost = GetIdPost.Substring(0, 16);
- var IDSp = IDPost.Split(new[] { "\"" }, StringSplitOptions.RemoveEmptyEntries);
- var Names = Name.Split(new[] { "\"" }, StringSplitOptions.RemoveEmptyEntries);
- if (!IDs.Contains(IDSp[0]))
- {
- IDs.Add(IDSp[0]);
- listBox2.Items.Add("" + IDSp[0] + " : " + Names[1]);
- listBox2.SelectedItem = listBox2.Items[listBox2.Items.Count - 1];
- label2.Text = "Member : " + IDs.Count;
- pictureBox1.Visible = true;
- }
- }
- }
- if (this.webBrowser1.Document != null)
- {
- webBrowser1.Document.Window.ScrollTo(0, webBrowser1.Document.Window.Size.Height);
- }
- }
- else timer1.Stop();
- }
- catch { timer1.Stop(); label2.Text = "Member : " + IDs.Count + " All Members"; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement