1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Your own artical spinner in python. :D

Discussion in 'Black Hat SEO' started by dr_0x, Aug 14, 2011.

  1. dr_0x

    dr_0x Junior Member

    Joined:
    May 9, 2010
    Messages:
    141
    Likes Received:
    169
    Home Page:
    I noticed this thread.
    Code:
    http://www.blackhatworld.com/blackhat-seo/black-hat-seo/340392-your-own-article-spinner-php.html
    
    I am now going to show everyone why I like python so much more than something like php.

    Article Spinner in Python.

    Code:
    import re
    def spinner(s):
        r = re.compile('{([^{}]*)}')
        while True:
            s, n = r.subn(select, s)
            if n == 0: break
        return s.strip()
    
    As you can see its like the php one from the thread above but in less than half the amount of code.

    Maybe you want to mix up the sentences so as to be more uniqe.

    Code:
    def splitsents(s):
        r = re.compile('(\?|\.|\!)')
        spun_sents = r.split(s)
        index = randint(0,len(spun_sents)-1)
        for n in range(0,2):
            i = spun_sents.pop(index)
            spun_sents.append(i)
        return ' '.join(spun_sents)
    
    Cheers! :D
     
    • Thanks Thanks x 2
  2. rippa911

    rippa911 Junior Member

    Joined:
    Jun 21, 2010
    Messages:
    112
    Likes Received:
    109
    lol nice. Thanks. I'm a big python fan
     
  3. dr_0x

    dr_0x Junior Member

    Joined:
    May 9, 2010
    Messages:
    141
    Likes Received:
    169
    Home Page:
    Hahaha. I can tell from you post in that other thread.
     
  4. yesrams

    yesrams Regular Member

    Joined:
    Dec 16, 2009
    Messages:
    354
    Likes Received:
    75
    Location:
    @BHW
    Hay, I am planning to learn python. This moment I have nill knowledge about python.
    Can you answer my Q's
    1. Can I code interact with web browser using python ( like webbrowser1 in vb.net)
    2. Can I write Automated tasks using with python (web related)
     
  5. dr_0x

    dr_0x Junior Member

    Joined:
    May 9, 2010
    Messages:
    141
    Likes Received:
    169
    Home Page:
    Code:
    http://code.google.com/p/pywebkitgtk/
    
    Yes, and yes.
     
  6. VIC SEO

    VIC SEO Elite Member

    Joined:
    Feb 19, 2010
    Messages:
    2,156
    Likes Received:
    363
    Gender:
    Male
    Occupation:
    SEO Specialist
    Location:
    iSynergyMedia
    Home Page:
    Thanks any way for the post on python and how it interacts with er, the web.