Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Newtonsoft.Json.Linq;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace InstaStealer
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- radioButton1.Checked = true;
- }
- public static string[] richToArray(RichTextBox textBox)
- {
- string[] lines = textBox.Text.Split(new char[] { '\r', '\n', '|', ' ' }, StringSplitOptions.RemoveEmptyEntries);
- string[] array = new string[lines.Length];
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = lines[i];
- }
- return array;
- }
- public static int getID(string domain)
- {
- try
- {
- //string query = Request.GET("http://127.0.0.1/api.php?act=id.get&nick=ykshv" + domain);
- //string matches = Regex.Match(query, "(?<=\"id\":\")(.*)(},\"moreAvailable)").ToString();
- //MessageBox.Show(matches);
- //return Convert.ToInt32(matches.Split('"')[0]);
- string query = Request.GET("http://127.0.0.1/api.php?act=id.get&nick=" + domain);
- return Convert.ToInt32(query);
- }
- catch
- {
- return 0;
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Config.token = "319636406.2e72465.ceece79a63054b8a908012717e76ad2a";
- Thread start = new Thread(Start);
- start.Start();
- }
- private void Logger(string text)
- {
- BeginInvoke(new MethodInvoker(delegate
- {
- richTextBox4.AppendText(text + Environment.NewLine);
- }));
- }
- private void Start()
- {
- BeginInvoke(new MethodInvoker(delegate
- {
- string[] accounts = richToArray(richTextBox3);
- foreach (string account in accounts)
- {
- Logger("Account: " + account);
- Logger("Getting ID...");
- int id = getID(account);
- Logger("ID: " + id);
- Logger("Get last likes...");
- getLastLiked(id);
- }
- }));
- }
- public void getLastLiked(int id)
- {
- string query = Api.Query("users/" + id.ToString() + "/media/recent");
- RootObject json = JsonConvert.DeserializeObject<RootObject>(query);
- string result = string.Empty;
- for(int i = 0; i < 4; i++)
- {
- foreach (Datum2 datum2 in json.data[i].likes.data)
- {
- result += datum2.username + ",";
- }
- }
- string[] users = result.Substring(0, result.Length - 1).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- foreach(string user in users)
- {
- Logger(user);
- }
- }
- }
- public class Pagination
- {
- public string next_url { get; set; }
- public string next_max_id { get; set; }
- }
- public class Meta
- {
- public int code { get; set; }
- }
- public class Location
- {
- public double latitude { get; set; }
- public string name { get; set; }
- public double longitude { get; set; }
- public int id { get; set; }
- }
- public class Comments
- {
- public int count { get; set; }
- public List<object> data { get; set; }
- }
- public class Datum2
- {
- public string username { get; set; }
- public string profile_picture { get; set; }
- public string id { get; set; }
- public string full_name { get; set; }
- }
- public class Likes
- {
- public int count { get; set; }
- public List<Datum2> data { get; set; }
- }
- public class LowResolution
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class Thumbnail
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class StandardResolution
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class Images
- {
- public LowResolution low_resolution { get; set; }
- public Thumbnail thumbnail { get; set; }
- public StandardResolution standard_resolution { get; set; }
- }
- public class From
- {
- public string username { get; set; }
- public string profile_picture { get; set; }
- public string id { get; set; }
- public string full_name { get; set; }
- }
- public class Caption
- {
- public string created_time { get; set; }
- public string text { get; set; }
- public From from { get; set; }
- public string id { get; set; }
- }
- public class User
- {
- public string username { get; set; }
- public string website { get; set; }
- public string profile_picture { get; set; }
- public string full_name { get; set; }
- public string bio { get; set; }
- public string id { get; set; }
- }
- public class LowBandwidth
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class StandardResolution2
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class LowResolution2
- {
- public string url { get; set; }
- public int width { get; set; }
- public int height { get; set; }
- }
- public class Videos
- {
- public LowBandwidth low_bandwidth { get; set; }
- public StandardResolution2 standard_resolution { get; set; }
- public LowResolution2 low_resolution { get; set; }
- }
- public class Datum
- {
- public object attribution { get; set; }
- public List<object> tags { get; set; }
- public string type { get; set; }
- public Location location { get; set; }
- public Comments comments { get; set; }
- public string filter { get; set; }
- public string created_time { get; set; }
- public string link { get; set; }
- public Likes likes { get; set; }
- public Images images { get; set; }
- public List<object> users_in_photo { get; set; }
- public Caption caption { get; set; }
- public bool user_has_liked { get; set; }
- public string id { get; set; }
- public User user { get; set; }
- public Videos videos { get; set; }
- }
- public class RootObject
- {
- public Pagination pagination { get; set; }
- public Meta meta { get; set; }
- public List<Datum> data { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement