Skip to content
WJunction - Webmaster Forum

SharpLeech WBB Plugin

Status
Not open for further replies.

l0calh0st

Distinguished Member
4,052
2010
713
Here is the working version of the WBB plugin written by Hyperz:
Code:
<?xml version="1.0" encoding="utf-8" ?>

<!-- SharpLeech 2.x.x SiteReader Plugin -->

<!-- Version MUST be in x.x.x.x format! -->
<SiteReader pluginVersion="2.0.0.0" pluginAuthor="Hyperz">
        <Settings>
                <SiteName>Warez-BB</SiteName>
                <BaseUrl>http://www.warez-bb.org</BaseUrl>
                <TopicsPerPage>50</TopicsPerPage>

                <!-- Supported type values are: IP.Board 3.x.x, IP.Board 2.x.x,
                         vBulletin 4.x.x, vBulletin 3.x.x, phpBB 3.x.x, phpBB 2.x.x -->
                <Type>phpBB 2.x.x</Type>

                <!-- If unsure choose ISO-8859-1. Except for phpBB 3 boards, they use UTF-8 by default. -->
                <DefaultEncoding>ISO-8859-1</DefaultEncoding>

                <!-- Set to true if the site uses SEO urls, otherwise false. -->
                <AllowRedirects>false</AllowRedirects>
                <UseFriendlyLinks>false</UseFriendlyLinks>
        </Settings>

        <Sections>
                <Section title="Apps" id="3" />
                <Section title="All-In-One (AIO)" id="47" />
                <Section title="Freewares and Betas" id="9" />
                <Section title="Games" id="5" />
                <Section title="Console Games" id="28" />
                <Section title="Movies" id="4" />
                <Section title="TV Shows" id="57" />
                <Section title="Anime" id="88" />
                <Section title="Music" id="6" />
                <Section title="Music Videos" id="38" />
                <Section title="Templates and Scripts" id="7" />
                <Section title="Template Rips" id="29" />
                <Section title="eBooks" id="8" />
                <Section title="Tutorials" id="83" />
                <Section title="Audio" id="91" />
                <Section title="Mac and Other OSes" id="20" />

                <!-- If you have an account with VIP access you can un-comment this (:
                <Section title="VIPs &amp; Donators" id="35" />
                -->
        </Sections>

        <!-- Edit this when the site requires custom parsing -->
        <Code>
                <![CDATA[
                
                protected override void Init()
                {
                        base.Init();
                        
                        // Whoever is tracking this over at WBB:
                        // Go ahead and keep blocking based on the user-agent value.
                        // By the time you're done you will have blocked 99% of your traffic. (:
                        
                        var f = "Mozilla/{0}.0 (compatible; MSIE {1}.0; Windows NT {2}.{3}; .NET CLR {4}.0.{5})";
                        var r = new Random();
                        var a = new String[]
                        {
                                "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; AskTB5.6)",
                                "Opera/9.80 (Linux armv7l; U; Maemo; Opera Mobi/3; it) Presto/2.5.26 Version/10.00",
                                "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/534.1+ (KHTML, like Gecko) Version/4.0.5 Safari/531",
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.0 (KHTML, like Gecko) Chrome/6.0.408.1 Safari/534.0",
                                "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.4; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0;",
                                "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3",
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                String.Format(f, r.Next(4, 5), r.Next(5, 9), r.Next(5, 6), r.Next(0, 1), r.Next(1, 4), r.Next(50000, 60000)),
                                "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3",
                                "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)",
                                "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
                        };
                        
                        Http.UserAgent = a[r.Next(0, a.Length - 1)];
                        Http.Proxy = null;
                }

                public override void LoginUser(string username, string password)
                {
                        base.LoginUser(username, password);
                }

                public override void LogoutUser()
                {
                        base.LogoutUser();
                }

                public override string[] GetTopicUrls(string html)
                {
                        return base.GetTopicUrls(html);
                }

                public override SiteTopic GetTopic(string url)
                {
                        // Fix 403 errors after reading a few topics
                        if (Http.SessionCookies["phpBB_WBB_t"] != null)
                        {
                                Http.SessionCookies["phpBB_WBB_t"].Value = String.Empty;
                        }
                        
                        SiteTopic topic = base.GetTopic(url);
                        
                        if (topic == null) return topic;
                        
                        string pattern = @"(?i)(?<match>\[code\]([\s\S]*?)\[/code\])";
                        string replace = "[hide]${match}[/hide]";
                        
                        topic.Content = System.Text.RegularExpressions.Regex.Replace(
                                topic.Content, pattern, replace);
                        
                        return topic;
                }

                public override SiteTopic GetTopic(int topicId)
                {
                        return base.GetTopic(topicId);
                }
                
                public override HttpWebRequest GetPage(int sectionId, int page, int siteTopicsPerPage)
                {
                        return base.GetPage(sectionId, page, siteTopicsPerPage);
                }

                public override void MakeReady(int sectionId)
                {
                        base.MakeReady(sectionId);
                }
                
                ]]>
        </Code>
</SiteReader>

Cheerz
 

3 comments

Is there not a WBB plugin with the SharpLeech when you download it ? Or does it not work anymore ? Correct me if I am wrong.

Thanks
Sik
 
Status
Not open for further replies.

About the author

L
Distinguished Member · Joined
4,052
Messages
713
Reactions
113
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom