Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. using Nuls.PluginBase;
  5. using Nuls.Core.StepClass;
  6. using Nuls.Core.StepClass.SpecialFields;
  7. using Nuls.Core.StepClass.Enums;
  8. using Nuls.Core.StepClass.LinkFormats;
  9. using Nuls.Utils.StringTools;
  10.  
  11. namespace Nuls.Plugins
  12. {
  13.     public class Ultraseek : PluginClass
  14.     {
  15.         // Parameterless Constructor - needed for Serialization
  16.         public Ultraseek() : this(null, null)
  17.         {
  18.         }
  19.        
  20.         public Ultraseek(string targetUrl, List<string> keywords)
  21.         {
  22.             // Add a Footprint so it gets hooked by our Harvester
  23.             FootPrints.AddRange(new string[] { "URL Status \"urlstatusgo.html\"",
  24.                                                 "\"urlstatusgo.html\" \"URL Status\"",
  25.                                                 "Disallowed by URL filter \"urlstatusgo.html\"",
  26.                                                 "Collection \"urlstatusgo.html\"",
  27.                                                 "Relative URL \"urlstatusgo.html\"",
  28.                                                 "Not in any search index \"urlstatusgo.html\"",
  29.                                                 "From the URL Database \"urlstatusgo.html\"",
  30.                                                 "Content-type \"urlstatusgo.html\"",
  31.                                                 "URL hash \"urlstatusgo.html\"",
  32.                                                 "Character encoding \"urlstatusgo.html\"",
  33.                                                 "Referring URL \"urlstatusgo.html\"",
  34.                                                 "Number of hops from root \"urlstatusgo.html\"o",
  35.                                                 "Last response code \"urlstatusgo.html\"",  
  36.                                                 "\"Disallowed by URL filter\" \"urlstatusgo.html\"",
  37.                                                 "\"Collection\" \"urlstatusgo.html\"",
  38.                                                 "\"Relative URL\" \"urlstatusgo.html\"",
  39.                                                 "\"Not in any search index.\" \"urlstatusgo.html\"",
  40.                                                 "\"From the URL Database\" \"urlstatusgo.html\"",
  41.                                                 "\"Content-type\" \"urlstatusgo.html\"",
  42.                                                 "\"URL hash\" \"urlstatusgo.html\"",
  43.                                                 "\"Character encoding\" \"urlstatusgo.html\"",
  44.                                                 "\"Referring URL\" \"urlstatusgo.html\"",
  45.                                                 "\"Number of hops from root\" \"urlstatusgo.html\"o",
  46.                                                 "\"Last response code\" \"urlstatusgo.html\"",});
  47.             Url        = targetUrl;
  48.             Keywords   = keywords;
  49.         }
  50.  
  51.         public override string Do(string url)
  52.         {
  53.             var trimmedUrl = UrlTrimmer.TrimToCurrentFolder(url);
  54.             var stepPlayer = new StepPlayer(trimmedUrl);
  55.  
  56.             var targetUrl = String.Format("{0}urlstatusgo.html?url={1}", trimmedUrl, Url);
  57.             var s = new Step();
  58.             s.GoTo(targetUrl);
  59.             s.IsLookupStep = true;
  60.             s.SpecialLookupUrl = targetUrl;
  61.             s.SuccessFullLinkPattern = "href=\"" + Url;
  62.             stepPlayer.Add(s);
  63.  
  64.             return stepPlayer.PerformSteps();
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement