Your own artical spinner in python. :D

dr_0x

Regular Member
Joined
May 9, 2010
Messages
307
Reaction score
266
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
 
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)
 
Code:
http://code.google.com/p/pywebkitgtk/

Yes, and yes.
 
Thanks any way for the post on python and how it interacts with er, the web.
 
Back
Top