Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.50 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Threading;
  3.  
  4. using Nuls.AntiCaptcha;
  5. using Nuls.Core.Items;
  6. using Nuls.Core.StepClass;
  7. using Nuls.Core.StepClass.Actions;
  8. using Nuls.Core.StepClass.Enums;
  9. using Nuls.Core.StepClass.LinkFormats;
  10. using Nuls.Core.StepClass.SpecialFields;
  11. using Nuls.Core.Harvester.Spiders;
  12. using Nuls.Utils.StringTools;
  13. using Nuls.PluginBase;
  14.  
  15.  
  16. using System.Web;
  17.  
  18. namespace Nuls.Plugins
  19. {
  20.     public class ASPXRedirects : PluginClass
  21.     {
  22.         public ASPXRedirects()
  23.             : this(null, null, null)
  24.         {
  25.         }
  26.  
  27.         public ASPXRedirects(string targetUrl, List<string> keywords, IAntiCaptcha antiCaptcha)
  28.         {
  29.             FootPrints.AddRange(new string[] {  "\"not responsible for the content of external sites\" \"redirect.aspx\""
  30.             });
  31.  
  32.             Url = targetUrl;
  33.             Keywords = keywords;
  34.             CaptchaInterface = antiCaptcha;
  35.         }
  36.  
  37.         public override string Do(string url)
  38.         {
  39.             var trimmedUrl = UrlTrimmer.TrimToCurrentFolder(url);
  40.             var stepPlayer = new StepPlayer(trimmedUrl);
  41.  
  42.             var targetUrl = System.String.Format("{0}redirect.aspx?url={1}", trimmedUrl, Url);
  43.  
  44.             var s = new Step();
  45.             s.GoTo(targetUrl);
  46.             s.IsLookupStep = true;
  47.             s.SpecialLookupUrl = targetUrl;
  48.             s.SuccessFullLinkPattern = "href=\"" + Url;
  49.             stepPlayer.Add(s);
  50.  
  51.             return stepPlayer.PerformSteps();
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement