Advertisement
Guest User

spaghetti

a guest
Mar 24th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Net;
  7. using System.Net.Http;
  8.  
  9. namespace nigger
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. string[] proxies = GetProxies();
  16.  
  17. string state = "dislike";
  18. string id = "121056";
  19.  
  20. foreach (var proxy in proxies)
  21. {
  22. new Thread(async () =>
  23. {
  24. CookieContainer cookies = new CookieContainer();
  25.  
  26. HttpClientHandler handler = new HttpClientHandler();
  27. handler.Proxy = new WebProxy(proxy);
  28. handler.CookieContainer = cookies;
  29.  
  30. HttpClient client = new HttpClient(handler);
  31.  
  32. try
  33. {
  34. await client.GetAsync("https://speedporn.net/");
  35.  
  36. Rate(client, id, state);
  37.  
  38. Console.WriteLine(state + "d!");
  39. }
  40. catch (HttpRequestException)
  41. {
  42. Console.WriteLine("Proxy error");
  43. }
  44. catch
  45. {
  46. Console.WriteLine("Unknown error");
  47. }
  48.  
  49. }).Start();
  50. }
  51. }
  52.  
  53. private static async void Rate(HttpClient client, string postId, string state)
  54. {
  55. try
  56. {
  57. string doc = await client.GetStringAsync("https://speedporn.net/?p=" + postId);
  58.  
  59. string nonce = GetNonce(doc);
  60.  
  61. var content = new StringContent($"action=post-like&nonce={nonce}&post_like={state}&post_id={postId}", Encoding.UTF8, "application/x-www-form-urlencoded");
  62.  
  63. await client.PostAsync("https://speedporn.net/wp-admin/admin-ajax.php", content);
  64. }
  65. catch (HttpRequestException)
  66. {
  67. Console.WriteLine("Proxy error");
  68. }
  69. }
  70.  
  71. private static string GetNonce(string doc)
  72. {
  73. string subStr = "\"nonce\":\"";
  74.  
  75. string sub = doc.Substring(doc.IndexOf(subStr) + subStr.Length);
  76. sub = sub.Split('"')[0];
  77.  
  78. return sub;
  79. }
  80.  
  81. private static string[] GetProxies()
  82. {
  83. HttpClient client = new HttpClient();
  84.  
  85. string resp = client.GetStringAsync("https://api.proxyscrape.com/?request=getproxies&proxytype=http").Result;
  86.  
  87. return resp.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement