|
Newbie
Registriert seit: 13.05.2010
Ort: Wuppertal
Beiträge: 19
Verwendet: Photoshop CS5 , Corel Draw X4
|
Visual C# / Facebook Gefällt mir Bot
Ich habe hier einen Facebook Gefällt mir Bot erstellt, der auch ein Browser darstellt,
Die Programmierung ist mit Visual C#
Form1.Designer.cs
PHP-Code:
namespace LikeTest { partial class Form1 { /// <summary> /// Copyright by JolliJoker Facebook Like Bot /// Erforderliche Designervariable. /// </summary> private System.ComponentModel.IContainer components = null;
/// <summary> /// Verwendete Ressourcen bereinigen. /// </summary> /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
#region Vom Windows Form-Designer generierter Code
/// <summary> /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.webBrowser1 = new System.Windows.Forms.WebBrowser(); this.button1 = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.button2 = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.textBox3 = new System.Windows.Forms.TextBox(); this.button5 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.monthCalendar1 = new System.Windows.Forms.MonthCalendar(); this.textBox2 = new System.Windows.Forms.TextBox(); this.button3 = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel2.SuspendLayout(); this.SuspendLayout(); // // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; this.webBrowser1.Location = new System.Drawing.Point(0, 0); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.Size = new System.Drawing.Size(1028, 504); this.webBrowser1.TabIndex = 0; this.webBrowser1.Url = new System.Uri("http://facebook.de", System.UriKind.Absolute); // // button1 // this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button1.Location = new System.Drawing.Point(337, 108); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(136, 30); this.button1.TabIndex = 1; this.button1.Text = "Like"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // timer1 // this.timer1.Interval = 300; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // button2 // this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button2.Location = new System.Drawing.Point(337, 144); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(136, 30); this.button2.TabIndex = 2; this.button2.Text = "Unlike"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(759, 183); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(240, 20); this.textBox1.TabIndex = 3; this.textBox1.Text = "2600"; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(612, 183); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(141, 20); this.label1.TabIndex = 4; this.label1.Text = "M.Sekunden Liken"; // // panel1 // this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaption; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.textBox3); this.panel1.Controls.Add(this.button5); this.panel1.Controls.Add(this.button4); this.panel1.Controls.Add(this.pictureBox1); this.panel1.Controls.Add(this.monthCalendar1); this.panel1.Controls.Add(this.textBox2); this.panel1.Controls.Add(this.button3); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.button2); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.button1); this.panel1.Controls.Add(this.textBox1); this.panel1.Location = new System.Drawing.Point(11, 20); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(1004, 210); this.panel1.TabIndex = 5; // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.Location = new System.Drawing.Point(-1, 10); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(38, 16); this.label6.TabIndex = 12; this.label6.Text = "URL"; // // textBox3 // this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBox3.Location = new System.Drawing.Point(37, 6); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(849, 22); this.textBox3.TabIndex = 13; this.textBox3.TextChanged += new System.EventHandler(this.textBox3_TextChanged); // // button5 // this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button5.Location = new System.Drawing.Point(892, 3); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(38, 29); this.button5.TabIndex = 11; this.button5.Text = "GO"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // button4 // this.button4.FlatStyle = System.Windows.Forms.FlatStyle.System; this.button4.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button4.Image = ((System.Drawing.Image)(resources.GetObject("button4.Image"))); this.button4.Location = new System.Drawing.Point(936, 3); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(63, 29); this.button4.TabIndex = 7; this.button4.Text = "CLOSE"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // pictureBox1 // this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(339, 37); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(320, 62); this.pictureBox1.TabIndex = 10; this.pictureBox1.TabStop = false; // // monthCalendar1 // this.monthCalendar1.CalendarDimensions = new System.Drawing.Size(2, 1); this.monthCalendar1.Location = new System.Drawing.Point(5, 53); this.monthCalendar1.Name = "monthCalendar1"; this.monthCalendar1.TabIndex = 9; // // textBox2 // this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBox2.Location = new System.Drawing.Point(469, 183); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(137, 22); this.textBox2.TabIndex = 8; this.textBox2.Text = "dein Kommentar!"; // // button3 // this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button3.Location = new System.Drawing.Point(327, 180); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(136, 28); this.button3.TabIndex = 7; this.button3.Text = "Kommentar"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.Location = new System.Drawing.Point(472, 148); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(115, 20); this.label3.TabIndex = 6; this.label3.Text = "Kommentare:"; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(479, 112); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(59, 20); this.label2.TabIndex = 5; this.label2.Text = "Posts:"; // // panel2 // this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel2.BackColor = System.Drawing.Color.White; this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Controls.Add(this.label5); this.panel2.Controls.Add(this.label4); this.panel2.Controls.Add(this.panel1); this.panel2.Location = new System.Drawing.Point(0, 253); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(1028, 251); this.panel2.TabIndex = 6; // // label5 // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(409, 1); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(149, 16); this.label5.TabIndex = 7; this.label5.Text = "JolliJoker´s Like Bot"; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(425, 233); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(111, 13); this.label4.TabIndex = 7; this.label4.Text = "Copyright by JolliJoker"; // // notifyIcon1 // this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "Facebook Like"; this.notifyIcon1.Visible = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1028, 504); this.Controls.Add(this.panel2); this.Controls.Add(this.webBrowser1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; this.Text = "Gefällt mir! Robot / Original Free for All"; this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.WebBrowser webBrowser1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Button button2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button button3; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.MonthCalendar monthCalendar1; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.Timer timer2; private System.Windows.Forms.Button button4; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Button button5; } }
Form1.cs
PHP-Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics;
namespace LikeTest // BOT LOADING = BOT LADEN {// Dieser Bot ist Programmiert worden, damit ich mal die API von Facebook Testen kann. public partial class Form1 : Form {// Das Programm ist Copyright by JolliJoker public Form1() {// Das Programm darf nicht verkauft, oder für den Missbrauch benutzt werden. InitializeComponent(); }// Die API ist Copyright by Facebook // Das Programm darf keinerlei umgeändert oder die Code Snipps benutzt oder als Eigenausgegeben werden. string modus = "like"; int kommentare = 0, post = 0; int elementIndex = 0; // wenn jemand dieses Programm Benutzt, sollte der auch wissen das er eventuell von Facebook gesperrt wird. int state = 0;
private void button1_Click(object sender, EventArgs e) {// IM BOT CLASS - ZU FIM V K //Button-like klick // Copyright by JolliJoker //die textboxen disablen textBox1.Enabled = false; textBox2.Enabled = false;
//modus wird im Timer wieder abgefragt modus = "like"; kommentare = 0; post = 0; elementIndex = 0; //index des ersten elements das geprüft werden soll timer1.Start(); //timer starten }
private void button2_Click(object sender, EventArgs e) { //Button-unlike klick
//die textboxen disablen textBox1.Enabled = false; textBox2.Enabled = false;
//modus wird im Timer wieder abgefragt modus = "unlike"; kommentare = 0; post = 0; elementIndex = 1000; //index des ersten elements das geprüft werden soll timer1.Start(); //timer starten }
private void button3_Click(object sender, EventArgs e) { //kommentar Button klick
//die textboxen disablen textBox1.Enabled = false; textBox2.Enabled = false;
//modus wird im Timer wieder abgefragt modus = "comment"; kommentare = 0; post = 0; elementIndex = 0; //index des ersten elements das geprüft werden soll timer1.Start(); //timer starten }
private void timer1_Tick(object sender, EventArgs e) { //um facebook die zeit zum laden zu lassen wird nach jeder aktion gewartet. Deshalb der timer. this.Text = elementIndex.ToString(); //formular name festlegen timer1.Interval = Convert.ToInt32(textBox1.Text); //timer intervall (millisekunden) aus textbox lesen while (elementIndex < webBrowser1.Document.All.Count) //solange es noch elemente auf der website gibt { if (modus == "like") { //den kommentar unter einem post liken if (webBrowser1.Document.All[elementIndex].GetAttribute("name").StartsWith("like_comment_id[")) { webBrowser1.Document.All[elementIndex].InvokeMember("click"); //klick post++; break; } //den post liken else if (webBrowser1.Document.All[elementIndex].GetAttribute("name") == "like") { webBrowser1.Document.All[elementIndex].InvokeMember("click"); //klick kommentare++; break; } //"alle kommentare anzeigen" klicken um mehr liken zu können else if (webBrowser1.Document.All[elementIndex].GetAttribute("name").StartsWith("view_all[")) { webBrowser1.Document.All[elementIndex].InvokeMember("click"); //klick break; } }
if (modus == "unlike") { //den kommentar unter einem post unliken if (webBrowser1.Document.All[elementIndex].GetAttribute("name").StartsWith("unlike_comment_id[")) { webBrowser1.Document.All[elementIndex].InvokeMember("click");//klick post++; break; } //den post unliken else if (webBrowser1.Document.All[elementIndex].GetAttribute("name") == "unlike") { webBrowser1.Document.All[elementIndex].InvokeMember("click");//klick kommentare++; break; } //"alle kommentare anzeigen" klicken um mehr unliken zu können else if (webBrowser1.Document.All[elementIndex].GetAttribute("name").StartsWith("view_all[")) { webBrowser1.Document.All[elementIndex].InvokeMember("click");//klick break; } }
if (modus == "comment") { //kommentieren per document in c# hat nach einer änderung von facebook nichtmehr funktioniert. //wenn ihr es zum laufen bekommt sagt mir bescheid
//if (webBrowser1.Document.All[elementIndex].GetAttribute("name") == "add_comment_text" && state == 0) //{ // try // { // webBrowser1.Document.All[elementIndex].Focus(); //den focus setzen / mit dem echten coursor rein klicken // } // catch { } // SendKeys.Send(textBox2.Text); //tastenanschläge simulieren // state = 1;
// elementIndex = elementIndex + 40; // post++; // break; //} //else if(state == 1) //{ // SendKeys.Send("{ENTER}"); //enter-taste simulieren // state = 2; // break; //} //else if (state == 2) //{ // state = 0; //} //webBrowser1.Document.All[i].InvokeMember("focus"); //webBrowser1.Document.All[i].InnerText = textBox2.Text; //webBrowser1.Document.All[i + 1].InvokeMember("click"); //den kommentieren link klicken if (webBrowser1.Document.All[elementIndex].GetAttribute("value").Contains("Kommentieren")) { webBrowser1.Document.All[elementIndex].InvokeMember("click"); SendKeys.Send(textBox2.Text); SendKeys.Send("{ENTER}"); elementIndex = elementIndex + 80; break; } }
//ausgabe/statistik updaten label2.Text = "Posts: " + post.ToString(); label3.Text = "Kommentare: " + kommentare.ToString();
//wenn alle elemente durchgegangen, dann messagebox und timer stop if (elementIndex >= webBrowser1.Document.All.Count) { timer1.Stop(); MessageBox.Show("Kommentare: " + kommentare.ToString() + Environment.NewLine + "Posts: " + post.ToString()); } elementIndex++; } }
private void label4_Click(object sender, EventArgs e) { Process.Start("http://www.Facebook.com"); }
private void textBox3_TextChanged(object sender, EventArgs e) { webBrowser1.Navigate(textBox3.Text); }
private void button4_Click(object sender, EventArgs e) { this.Close(); }
private void button5_Click(object sender, EventArgs e) { webBrowser1.Navigate(textBox3.Text); } } }
Programm.cs
PHP-Code:
using System; using System.Collections.Generic; using System.Windows.Forms;
namespace LikeBOT { static class Program { /// <summary> /// Der Haupteinstiegspunkt für die Anwendung. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
Download Link:
http://ul.to/5xmv28yn
verbesserungsvorschläge sind gern gesehen.
Geändert von JolliJoker (30.03.2012 um 14:26 Uhr).
|
Social Media