Making Money with Python

Which part is confusing to you, the telegram poster? )
Looks like a cpa setup )
I am not aware how this setup works, i only know that they are using wp safelink, i don't know how they are uploading and sharing template msg on automation.
 
I think your password generator can be shorten to 2 line :D

Code:
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(16))
yes indeed. You start with the basics that come to your head and then you discover libs and you progress with time :)
 
@Paranoid Android bro can you please suggest me how to do automation like this https://t.me/Vmodders telegram.

I am not sure how to search for bot like this they are using api and auto poster bot's for automation.

They are just sending file and it uploaded that file to remote server and create short link and share that short link with template.

Anybody can contribute your idea's i am open for your ideas
I'm sorry I haven't messed with telegram or other social media bots yet. There are plenty of solutions for every imaginable problem on github already
 
I'm sorry I haven't messed with telegram or other social media bots yet. There are plenty of solutions for every imaginable problem on github already
I have dig so many repos of git but didn't find what i need, may be the search terms i am using are wrong.
 
I have dig so many repos of git but didn't find what i need, may be the search terms i am using are wrong.
Well, if you could formulate properly EXACTLY what you are looking for we could definitely get you on the right track.
 
Post answers to your questions from OpenAI to wordpress

Signup to OpenAI.com and get a free $18 credit and an API key. Stick the API key into the script, insert wordpress domain, username and application password. Please find out how to create an Application Password so that you don't have to use your real password.

Install pyCharm or IDLE, install the required libraries shown in the top 2 lines. If you don't know how to do this, learn.

Enter 1 question per line, or use a file q.txt to import a bunch of questions.

Choose to save output in files to be used later, or have them posted to wp directly, or post the content from files to wp. Sell the content files, do what you want with it.
Be sure to format questions properly and ask very descriptive questions and include a word count too if possible as required.

So, here is the code. Not fully debugged, error handling not done properly. My first test worked and I'm posting this here. Will improve on this depending on how welcome this script is on the forum.

I hope the human writers of BHW don't gang up and order a hit on me. I'm doing this for dopamine, nothing else.

Python:
import os,openai, requests, random, base64
from concurrent.futures import ProcessPoolExecutor

'''OpenAI Key goes within the quotes'''
openai_key = 'Key Here'

# WP
wordpress_domain = '' ##DO NOT INCLUDE HTTPS OR WWW OR ANY TRAILING SLASHES. ONLY ENTER domainname.tld
wordpress_username = ''
wordpress_application_password = ''

wordpress_post_status = 'draft'

# OpenAI Tweaks
aiTemperature = 0.7
maxTokens = 100

'''Paths. Change these only if you know wtf you're doing'''
generated_content = 'new_content_files/'
uploaded_content = 'content_uploaded_to_wp/'

# Menu Items
singleq = ('''OpenAI is a bitch. Please format your questions clearly.
        Sample Question: Tell me about guitar strings in 200 words
        Sample Answer below has only 199 words... OpenAI is a bitch

        Guitar strings are one of the most important aspects of the instrument, and the type of string you use can have
        a big impact on your sound. There are a variety of different types of strings available, each with their own
        unique properties.

        The most common type of string is the steel string, which is most often used on acoustic guitars. Steel strings
        are known for their bright, clear tone and are a good choice for most styles of music.

        If you're looking for a warmer, more mellow sound, you might want to try a set of nylon strings. Nylon strings
        are typically used on classical and flamenco guitars, and they offer a softer, more delicate sound.

        If you're looking for the ultimate in shredding capabilities, you'll want to check out a set of stainless steel
        strings. These strings are incredibly durable and can stand up to serious abuse, making them a good choice for
        metal and hard rock players.

        No matter what type of music you play, there's a set of guitar strings that's perfect for you. With so many
        different types available, there's no reason not to experiment until you find the perfect set for your sound.

        So, type in your question accordingly: ''')

mainmenu = '''
    Howdy!

        Hit
            1: Generate Articles and write them to file
            2: Generate Articles and post them to Wordpress
            3: Read Articles from file and post them to Wordpress
            4: Quit

        Wachawannado? : '''

a2menu = '''
        1: Imput single question here
        2: Read list of questions from file (One question per line)
        3: Go back to previous menu

        Wachawannadonow? : '''


def post2wp(q, i, flag, content):
    if flag:
        openai.api_key = openai_key
        content = openai.Completion.create(model="text-davinci-002", prompt=q, temperature=aiTemperature,
                                           max_tokens=maxTokens)["choices"][0]["text"]

    cred = f'{wordpress_username}:{wordpress_application_password}'
    tkn = base64.b64encode(cred.encode())
    wpheader = {'Authorization': 'Basic ' + tkn.decode('utf-8')}
    api_url = f'https://{wordpress_domain}/wp-json/wp/v2/posts'
    data = {
    'title' : q.capitalize(),
    'status': wordpress_post_status,
    'content': content,
    }
    print(content)
    wp_response = requests.post(url=api_url,headers=wpheader, json=data)
    print(f'Item no. {i+1} posted, with title{q} and post content \n\n {content} \n\n {wp_response})


def article2file(q,i):
    openai.api_key = openai_key
    response = openai.Completion.create(model="text-davinci-002", prompt=q, temperature=aiTemperature,
                                        max_tokens=maxTokens)["choices"][0]["text"]
    fname = q.replace(' ', '_') + '.txt'
    if os.path.exists(generated_content+fname):
        print('File with title already exists, renaming it with a random number prefix')
        os.replace(generated_content+fname,generated_content+str(random.randint(1000,9999))+fname)
    with open(generated_content+fname, 'w') as f:
        f.write(response)
        print(f'Item: {i} in list done.\nQuery string: {q}\nArticle:\n{response}\n\nSaved to {fname}')





if __name__ == '__main__':
    if not os.path.exists(generated_content):
        os.mkdir(generated_content)
    if not os.path.exists(uploaded_content):
        os.mkdir(uploaded_content)
    try:
        while True:
            try:
                wachawannado = int(input(mainmenu))
            except ValueError:
                print('\nPlease enter a number')
                continue
            if wachawannado == 1: #Article to file
                try:
                    wachawannadonow = int(input(a2menu))
                except ValueError:
                    print('\nPlease enter a number')
                    continue
                if wachawannadonow == 1: #a2f single
                    article2file(q=input(singleq), i=1)

                elif wachawannadonow == 2: #a2f file
                    if os.path.exists('q.txt'):
                        if not os.stat("file").st_size == 0:
                            with open('q.txt', 'r') as f:
                                with ProcessPoolExecutor(max_workers=16) as executor:
                                    for i, line in enumerate(f):
                                        executor.submit(article2file, i=i, q=line)
                        else:
                            print('\nq.txt is empty')
                            continue
                    else:
                        print("Can't find q.txt")
                        continue
                else:
                    continue

            elif wachawannado == 2: #Article to Wordpress
                try:
                    wachawannadonow = int(input(a2menu))
                except ValueError:
                    print('\nPlease enter a number')
                    continue
                if wachawannadonow == 1: #a2wp single
                    post2wp(q=input(singleq), i=1, flag = True, content = '')
                elif wachawannadonow == 2: #a2wp file
                    if os.path.exists('q.txt'):
                        if not os.stat("file").st_size == 0:
                            with open('q.txt', 'r') as f:
                                with ProcessPoolExecutor(max_workers=16) as executor:
                                    for i, line in enumerate(f):
                                        executor.submit(post2wp, q=line, i=i, flag = True, content = '')
                        else:
                            print('\nq.txt is empty')
                            continue
                    else:
                        print("Can't find q.txt")
                        continue
                else:
                    continue
            elif wachawannado == 3: #Files to WP
                contentfiles = os.listdir(generated_content)
                if contentfiles:
                    with ProcessPoolExecutor(max_workers=16) as executor:
                        for i, file in enumerate(contentfiles):
                            if file.endswith('.txt'):
                                print('Posting from file:', file)
                                with open(generated_content+file,'r') as f:
                                    executor.submit(post2wp, flag = False, content = f.read(), q = file.replace('_', '').replace('.txt',''), i=i)
                                os.replace(generated_content+file, uploaded_content+file)
                else:
                    print('Generated Content folder is empty')
            elif wachawannado == 4:
                print('Bye!')
                break
            else:
                print('Invalid Choice, try that again')
    except KeyboardInterrupt:
        print('Bye!')

Please post your questions, requests, comments, suggestions, bug reports (150 lines of code can't have that many bugs) right here. PM me and it will be I ordering a hitman for you.
Can you help me on this, when I try to read the q.txt file it only reads one question (out of several), I don't know how to make it send each question that is in the file to openAI.

Thanks in advance
 
Can you help me on this, when I try to read the q.txt file it only reads one question (out of several), I don't know how to make it send each question that is in the file to openAI.

Thanks in advance
one question per line as it reads one line at a time
 
Dude, if you read anything I wrote, you'd know I hate scrapers. Bots and humans
 
Your Own TikTok video maker bot

Do you look fugly even with filters? Do you sound like a croaking toad? Are you camera shy to make videos of yourself? Or are you just so damn lazy to use a video editor to make your own shorts from stock footage? Are you having to pay people on Fiverr to do it for you? Paranoid Android on Beast Mode is here for your rescue.

Get your API key from OpenAI.com, sign up and get a free $18 credit with the key. This is plenty to get you started
Install pycharm or your favorite python IDE and paste the script below.
Install all the libraries, pycharm makes it easy if you don't know what you're doing.
Run the script.


Order of execution:
1. Download background videos first. You can pick from copyright free playlists, single videos, or from a built in list of 4 videos.
2. Create Audio. Pass in a well formatted question about the topic, or make a list in a file q.txt and let OpenAI generate the text for you, which is then converted to voice files with Google Text to Speech
3. Make videos from the created audio files.
4. Upload to youtube or tiktok and watch the money roll in

If the Audio length is less than 60 secs, video is made to that length, and if the audio is longer than 60 secs, it gets trimmed to 60 secs. Play around with openai for a bit to figure out the optimal question format for what you're asking if you don't want too much of valuable information cut off in the end.

Audio creation is multithreaded so it is all done in almost no time if you have an ssd, and the background video downloads (required once) will depend on your internet speeds. But the videomaking at 1080x1920p resolution takes about 15 minutes per video on my 8 core Ryzen laptop with 16 gigs of ram running linux. So if you're going to be making multiple videos, you're going to have to leave your computer running when you're sleeping.

Wanna make your videos with your own audio? I've seen people do it with funny call recordings and stuff on TikTok. Just put your audio inside the 'tts' folder (after running the script once so the folders are created), and hit option 3 to get the audio cropped to 60 seconds and videos of exactly 1800 frames.

Python:
import concurrent.futures
import openai, os, random, time
from gtts import gTTS
import moviepy.editor as mp
from mutagen.mp3 import MP3
from pytube import Playlist, YouTube
from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.audio.io.AudioFileClip import AudioFileClip

openai.api_key = "Your Key Here"
videoHeight = 1920


audiopath = 'tts/'
videopath = 'finalvideo/'

mainMenu = '''
    1. Make Audio from list in q.txt
    2. Input a question manually to make audio
    3. Make videos from available audio
    4. Download new backgrounds
    5. Exit
        Wachawannado? : '''

bgvdMainMenu = '''
1. Pull from a Playlist link
2.Pull from a video link Video
3. Download built in List of Videos Or any other key to return
  Wachawannado? : '''


def audioMaker(i, q):
    q = q.strip('\n')
    response = openai.Completion.create(
        model="text-davinci-002",
        prompt=q,
        temperature=0.7,
        max_tokens=500,
        top_p=1.0,
        frequency_penalty=0.0,
        presence_penalty=0.0
    )
    print(q, 'done')
    tts = gTTS(text=response["choices"][0]["text"], tld='ca', slow=False)
    if os.path.exists(f"tts/{q.replace(' ', '_')}.mp3"):
        newfilename = '_' + q.replace(' ', '_') + '.mp3'
        tts.save(f"tmp/{newfilename.replace(' ', '_')}.mp3")
        os.replace(f"tmp/{newfilename.replace(' ', '_')}.mp3", f"tts/{newfilename.replace(' ', '_')}.mp3")
        print('iteration', i, q, 'saved')
    else:
        tts.save(f"tmp/{q.replace(' ', '_')}.mp3")
        os.replace(f"tmp/{q.replace(' ', '_')}.mp3", f"tts/{q.replace(' ', '_')}.mp3")
        print('iteration', i, q, 'saved')


def videoMaker():
    aflist = os.listdir(path='tts/')
    for i, fname in enumerate(aflist):
        retry = 0
        if fname.endswith('.mp3'):
            while True:
                randomVideo = random.choice(os.listdir('bgvideo/'))
                if randomVideo.endswith('.mp4'):
                    backgroundVideo = VideoFileClip('bgvideo/' + randomVideo).without_audio().resize(height=videoHeight).crop(x1=1166.6, y1=0, x2=2246.6, y2=1920)
                    audioFileDuration = MP3(audiopath + fname).info.length
                    if  audioFileDuration < 60:
                        audioDuration = audioFileDuration
                        audioClip = mp.CompositeAudioClip([AudioFileClip(audiopath + fname)])
                        print('video length is shorter than 60 secs', audioDuration)
                    else:
                        audioDuration = 60
                        audioClip = mp.CompositeAudioClip([AudioFileClip(audiopath + fname)]).subclip(0, 60)
                    videoDuration = backgroundVideo.duration
                    if videoDuration >= audioDuration:
                        randRange = random.randrange(30, int(videoDuration - audioDuration))
                        videoSubClip = backgroundVideo.subclip(randRange, randRange + audioDuration)
                        print('found a video longer than audio')

                        videoSubClip.audio = audioClip
                        videoSubClip.write_videofile('tmp/' + fname.replace('.mp3', '.mp4'), fps=30, audio_codec='aac',
                                                     audio_bitrate='192k', verbose=True, threads=os.cpu_count())
                        os.replace(audiopath + fname, 'usedaudio/' + fname)
                        os.replace('tmp/'+ fname.replace('.mp3', '.mp4'), videopath + fname.replace('.mp3', '.mp4'))
                        break
                    else:
                        retry += 1
                        print('video is shorter than your fucking dick, retrying : ', retry + 1)
                        if retry > 10:
                            print('Audio probably too long, skipping after 10 tries. Skipping audio', fname)
                            os.replace(audiopath + fname, 'audiotoolong/' + fname)
                            break


def backgroundVideoDownloader():
    opt = int(input(bgvdMainMenu))
    if opt == 1:
        p = Playlist(input('What is the playlist link? : '))
        n = int(input('How many videos do you want to download?\n Hit 0 for all : '))
        for i, video in enumerate(p.videos):
            vidtitle = str(random.randint(100000, 1000000)) + '.mp4'
            print('Downloading', vidtitle)
            video.streams.filter(res="1080p").first().download(output_path='tmp/', filename=vidtitle, timeout=30,
                                                               max_retries=3, skip_existing=False)
            if os.path.exists('bgvideo/' + vidtitle):
                altvidtitle = str(random.randint(100000, 1000000)) + '.mp4'
                os.replace('tmp/' + vidtitle, 'bgvideo/' + altvidtitle)
            else:
                os.replace('tmp/' + vidtitle, 'bgvideo/' + vidtitle)
            print(i + 1, video.title, 'downloaded as', vidtitle)
            if i + 1 == n:
                break
    elif opt == 2:
        vidtitle = str(random.randint(100000, 1000000)) + '.mp4'
        p = YouTube(input('What is the video link? : '))
        p.streams.filter(res="1080p").first().download(output_path='tmp/', filename=vidtitle, skip_existing=False)
        if os.path.exists('bgvideo/' + vidtitle):
            altvidtitle = str(random.randint(100000, 1000000)) + '.mp4'
            os.replace('tmp/' + vidtitle, 'bgvideo/' + altvidtitle)
            print(p.title, 'downloaded as', altvidtitle)
        else:
            os.replace('tmp/' + vidtitle, 'bgvideo/' + vidtitle)
            print(p.title, 'downloaded as', vidtitle)
        print(p.title, 'downloaded')
    elif opt == 3:
        builtInListOfVideos = ["https://www.youtube.com/watch?v=vw5L4xCPy9Q", "https://www.youtube.com/watch?v=2X9QGY__0II", "https://www.youtube.com/watch?v=n_Dv4JMiwK8", "https://www.youtube.com/watch?v=qGa9kWREOnE"]
        for v in builtInListOfVideos:
            vidtitle = str(random.randint(100000, 1000000)) + '.mp4'
            YouTube(v).streams.filter(res="1080p").first().download(output_path='tmp/', filename=vidtitle, skip_existing=False)
            if os.path.exists('bgvideo/' + vidtitle):
                altvidtitle = str(random.randint(100000, 1000000)) + '.mp4'
                os.replace('tmp/' + vidtitle, 'bgvideo/' + altvidtitle)
                print(YouTube(v).title, 'downloaded as', altvidtitle)
            else:
                os.replace('tmp/' + vidtitle, 'bgvideo/' + vidtitle)
                print(YouTube(v).title, 'downloaded as', vidtitle)
            print(YouTube(v).title, 'downloaded')
    else:
        print('returning to main menu')
        return


if __name__ == '__main__':
    if not os.path.exists(audiopath):
        os.mkdir('tts')
    if not os.path.exists('audiotoolong/'):
        os.mkdir('audiotoolong')
    if not os.path.exists('bgvideo/'):
        os.mkdir('bgvideo')
    if not os.path.exists(videopath):
        os.mkdir('finalvideo')
    if not os.path.exists('tmp/'):
        os.mkdir('tmp')
    if not os.path.exists('usedaudio/'):
        os.mkdir('usedaudio')
    try:
        while True:
            wachawannado = int(input(mainMenu))
            if wachawannado == 1:
                if os.path.exists('q.txt'):
                    with open('q.txt', 'r') as q:
                        with concurrent.futures.ProcessPoolExecutor(max_workers=64) as executor:
                            for i, lines in enumerate(q):
                                executor.submit(audioMaker, i=i, q=lines)
                else:
                    print('q.txt not found. Create q.txt or hit 2 in the main menu')
            elif wachawannado == 2:
                audioMaker(q=input('Type a well worded clearly formatted question. Simple questions return very short answers: '), i=1)
            elif wachawannado == 3:
                videoMaker()
            elif wachawannado == 4:
                backgroundVideoDownloader()
            elif wachawannado == 5:
                print('Bye!')
                break
            else:
                print('\nLets try again\n')

    except KeyboardInterrupt:
        tmpdir = os.listdir('tmp/')
        if not tmpdir:
            print('\ntmp folder is empty, Bye!')
        else:
            for i, file in enumerate(tmpdir):
                os.remove('tmp/' + file)
            print(f'\n{i + 1} files cleared from the tmp folder. Bye!')

Sample output : https://www.dropbox.com/s/t7qpepk9i...ter_purification_plants_purify_water.mp4?dl=0
Question was 'Tell me in detail how commercial water purification plants purity water'
The video lasts only 30 secs. I'll let you play with it to find out how to make them around exactly 60 mins

So OpenAI dropped its prices for DaVinci from $0.6 to $0.2 per 1000 tokens, and I decided to make an exe of the quoted script as there have been lots of people PMing me and messaging me to tell me that they are unable to set up the environment to work.

Here you go : https://videosynthesis.90sUI.com

VT: https://www.virustotal.com/gui/url/...b4eba3b458fe506338295055a1f86284237?nocache=1

I built it from source and uploaded it immediately. Please do your own virus scan anyway.

HowTo:
1. Start by downloading the background videos from option 4, and then 3 for downloading the built in list of videos.
2. Hit 2 and pass in a detailed question, such as tell me in detail how an air conditioner works
3. Make a list of such questions and put them in a file named q.txt and put it in the same folder as the exe and hit 1

All of these makes only the Audio.

4. Once the audio is made, you need to hit 3 to make videos from available audio.

if you have your own audio, and if you dont' want to pay openAI after your grant runs out, put them all in the tts folder that will be created after the first run.

Enjoy!
 
Last edited:
Any pinning bot o mn auto for pinterest and auto scraper for proxies for SB
 
Great thread @Paranoid Android

How long will it take me to learn this skill, creating such tools with Python starting from scratch?
 
Don't know, I could say it took me 60 days, but it has been more like 20 years if you account for all the time I wasted away managing servers.
 
Post answers to your questions from OpenAI to wordpress

Signup to OpenAI.com and get a free $18 credit and an API key. Stick the API key into the script, insert wordpress domain, username and application password. Please find out how to create an Application Password so that you don't have to use your real password.

Install pyCharm or IDLE, install the required libraries shown in the top 2 lines. If you don't know how to do this, learn.

Enter 1 question per line, or use a file q.txt to import a bunch of questions.

Choose to save output in files to be used later, or have them posted to wp directly, or post the content from files to wp. Sell the content files, do what you want with it.
Be sure to format questions properly and ask very descriptive questions and include a word count too if possible as required.

So, here is the code. Not fully debugged, error handling not done properly. My first test worked and I'm posting this here. Will improve on this depending on how welcome this script is on the forum.

I hope the human writers of BHW don't gang up and order a hit on me. I'm doing this for dopamine, nothing else.

Python:
import os,openai, requests, random, base64
from concurrent.futures import ProcessPoolExecutor

'''OpenAI Key goes within the quotes'''
openai_key = 'Key Here'

# WP
wordpress_domain = '' ##DO NOT INCLUDE HTTPS OR WWW OR ANY TRAILING SLASHES. ONLY ENTER domainname.tld
wordpress_username = ''
wordpress_application_password = ''

wordpress_post_status = 'draft'

# OpenAI Tweaks
aiTemperature = 0.7
maxTokens = 100

'''Paths. Change these only if you know wtf you're doing'''
generated_content = 'new_content_files/'
uploaded_content = 'content_uploaded_to_wp/'

# Menu Items
singleq = ('''OpenAI is a bitch. Please format your questions clearly.
        Sample Question: Tell me about guitar strings in 200 words
        Sample Answer below has only 199 words... OpenAI is a bitch

        Guitar strings are one of the most important aspects of the instrument, and the type of string you use can have
        a big impact on your sound. There are a variety of different types of strings available, each with their own
        unique properties.

        The most common type of string is the steel string, which is most often used on acoustic guitars. Steel strings
        are known for their bright, clear tone and are a good choice for most styles of music.

        If you're looking for a warmer, more mellow sound, you might want to try a set of nylon strings. Nylon strings
        are typically used on classical and flamenco guitars, and they offer a softer, more delicate sound.

        If you're looking for the ultimate in shredding capabilities, you'll want to check out a set of stainless steel
        strings. These strings are incredibly durable and can stand up to serious abuse, making them a good choice for
        metal and hard rock players.

        No matter what type of music you play, there's a set of guitar strings that's perfect for you. With so many
        different types available, there's no reason not to experiment until you find the perfect set for your sound.

        So, type in your question accordingly: ''')

mainmenu = '''
    Howdy!

        Hit
            1: Generate Articles and write them to file
            2: Generate Articles and post them to Wordpress
            3: Read Articles from file and post them to Wordpress
            4: Quit

        Wachawannado? : '''

a2menu = '''
        1: Imput single question here
        2: Read list of questions from file (One question per line)
        3: Go back to previous menu

        Wachawannadonow? : '''


def post2wp(q, i, flag, content):
    if flag:
        openai.api_key = openai_key
        content = openai.Completion.create(model="text-davinci-002", prompt=q, temperature=aiTemperature,
                                           max_tokens=maxTokens)["choices"][0]["text"]

    cred = f'{wordpress_username}:{wordpress_application_password}'
    tkn = base64.b64encode(cred.encode())
    wpheader = {'Authorization': 'Basic ' + tkn.decode('utf-8')}
    api_url = f'https://{wordpress_domain}/wp-json/wp/v2/posts'
    data = {
    'title' : q.capitalize(),
    'status': wordpress_post_status,
    'content': content,
    }
    print(content)
    wp_response = requests.post(url=api_url,headers=wpheader, json=data)
    print(f'Item no. {i+1} posted, with title{q} and post content \n\n {content} \n\n {wp_response})


def article2file(q,i):
    openai.api_key = openai_key
    response = openai.Completion.create(model="text-davinci-002", prompt=q, temperature=aiTemperature,
                                        max_tokens=maxTokens)["choices"][0]["text"]
    fname = q.replace(' ', '_') + '.txt'
    if os.path.exists(generated_content+fname):
        print('File with title already exists, renaming it with a random number prefix')
        os.replace(generated_content+fname,generated_content+str(random.randint(1000,9999))+fname)
    with open(generated_content+fname, 'w') as f:
        f.write(response)
        print(f'Item: {i} in list done.\nQuery string: {q}\nArticle:\n{response}\n\nSaved to {fname}')





if __name__ == '__main__':
    if not os.path.exists(generated_content):
        os.mkdir(generated_content)
    if not os.path.exists(uploaded_content):
        os.mkdir(uploaded_content)
    try:
        while True:
            try:
                wachawannado = int(input(mainmenu))
            except ValueError:
                print('\nPlease enter a number')
                continue
            if wachawannado == 1: #Article to file
                try:
                    wachawannadonow = int(input(a2menu))
                except ValueError:
                    print('\nPlease enter a number')
                    continue
                if wachawannadonow == 1: #a2f single
                    article2file(q=input(singleq), i=1)

                elif wachawannadonow == 2: #a2f file
                    if os.path.exists('q.txt'):
                        if not os.stat("file").st_size == 0:
                            with open('q.txt', 'r') as f:
                                with ProcessPoolExecutor(max_workers=16) as executor:
                                    for i, line in enumerate(f):
                                        executor.submit(article2file, i=i, q=line)
                        else:
                            print('\nq.txt is empty')
                            continue
                    else:
                        print("Can't find q.txt")
                        continue
                else:
                    continue

            elif wachawannado == 2: #Article to Wordpress
                try:
                    wachawannadonow = int(input(a2menu))
                except ValueError:
                    print('\nPlease enter a number')
                    continue
                if wachawannadonow == 1: #a2wp single
                    post2wp(q=input(singleq), i=1, flag = True, content = '')
                elif wachawannadonow == 2: #a2wp file
                    if os.path.exists('q.txt'):
                        if not os.stat("file").st_size == 0:
                            with open('q.txt', 'r') as f:
                                with ProcessPoolExecutor(max_workers=16) as executor:
                                    for i, line in enumerate(f):
                                        executor.submit(post2wp, q=line, i=i, flag = True, content = '')
                        else:
                            print('\nq.txt is empty')
                            continue
                    else:
                        print("Can't find q.txt")
                        continue
                else:
                    continue
            elif wachawannado == 3: #Files to WP
                contentfiles = os.listdir(generated_content)
                if contentfiles:
                    with ProcessPoolExecutor(max_workers=16) as executor:
                        for i, file in enumerate(contentfiles):
                            if file.endswith('.txt'):
                                print('Posting from file:', file)
                                with open(generated_content+file,'r') as f:
                                    executor.submit(post2wp, flag = False, content = f.read(), q = file.replace('_', '').replace('.txt',''), i=i)
                                os.replace(generated_content+file, uploaded_content+file)
                else:
                    print('Generated Content folder is empty')
            elif wachawannado == 4:
                print('Bye!')
                break
            else:
                print('Invalid Choice, try that again')
    except KeyboardInterrupt:
        print('Bye!')

Please post your questions, requests, comments, suggestions, bug reports (150 lines of code can't have that many bugs) right here. PM me and it will be I ordering a hitman for you.

A few people said they couldn't get this to run on their python environments, so I made it into an exe.

Download it here.

ClamAV thinks there is a trojan but Avast and the others don't. I do all my coding on a mac and wipe my windows machine before every new compile to keep the virus away, so this could be a false positive.

On the first run an ini file will be created on the same folder as the exe. Please open that on notepad and fill in the necessary information. It will not work without the openAI key. OpenAI has dropped the price for davinci from 60 cents to 20 cents per K tokens (or is it 2 cents to 6 cents per k? Never really checked my openAI bills). Also a few months ago they were giving away free credits for new signups, I don't know if thats still there. Please find out.

So You definitely need the OpenAI key on the ini file, and if you choose to post the outputs directly to wordpress, you need your wordpress login, domain and the appliation password. Please use google to find out how to make an application password if you're not familiar with it. You can leave the post_status as draft unless you want to publish them without review, in which case the status needs to be set to publish

You have the option to change the temperature and model for OpenAI, change them if you know what you're doing or just leave them as they are.

Like we say in the south of India, Yenjaai !
 
Last edited:
I made a few beginner's attempts at making a few python scripts that could make a few bucks at least per run. My codes don't look pretty, some of my variables and prompts are profane, and you pros out there might go roflwtf, but I hope to be able to fix all of that and code like a pro soon enough.

You need a local python environment if you don't have it already. There is IDLE, and theres PyCharm CE that you can install after installing IDLE. I like TextEdit on Ubuntu and the shell for execution. Suit yourself.

I have also put up this thread where fellow members tell me what they need and I code it up for them. I am making this thread to post those working scripts that everyone can use. Thought I'd start off first by posting what I have done so far, which would start from my 2nd post.

Before we get to the moneymakers, I'd like to show off a few scripts that I felt so proud of.

Here is a password generator to start with
Python:
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
ln=5
nn=4
sn=3
password=[]
for i in range(0,ln):
    password+=letters[random.randint(0,len(letters)-1)]
for i in range(0, nn):
    password+=numbers[random.randint(0,len(numbers)-1)]
for i in range(0, sn):
    password+=symbols[random.randint(0,len(symbols)-1)]
random.shuffle(password)
pw=''
for char in password:
    pw+=char
print(f'Password: {pw}')

The Lucas Lehmer method of finding Mersenne Prime, without which the SSLs don't work. Got the method from this video

Python:
import time



i = 4
l = 1
start_time = time.time()
n=int(input('n = '))
pn = (2 ** n) - 1

if pn % 2 == 0:
    print(f'{pn} is a fucking even number')
else:
    print(f"the number you're solving for is {pn}\nCalculating...")
    while i < pn:
        i = (i ** 2) - 2
        l += 1
    print(l, 'loop 1 ')
    i = i % pn
    while l < n - 1:
        i = (i ** 2) - 2
        i = i % pn
        l += 1
    print(l, 'loop2 ')
    if (i % (pn)) == 0:
        print(f'2^{n} - 1 is a prime')
        print("--- %s seconds ---" % (time.time() - start_time))
    else:
        print(f'2^{n} - 1 isnt a prime')
        print("--- %s seconds ---" % (time.time() - start_time))
How long did it take you to master your python skills?
 
A few people said they couldn't get this to run on their python environments, so I made it into an exe.

Download it here.

ClamAV thinks there is a trojan but Avast and the others don't. I do all my coding on a mac and wipe my windows machine before every new compile to keep the virus away, so this could be a false positive.

On the first run an ini file will be created on the same folder as the exe. Please open that on notepad and fill in the necessary information. It will not work without the openAI key. OpenAI has dropped the price for davinci from 60 cents to 20 cents per K tokens (or is it 2 cents to 6 cents per k? Never really checked my openAI bills). Also a few months ago they were giving away free credits for new signups, I don't know if thats still there. Please find out.

So You definitely need the OpenAI key on the ini file, and if you choose to post the outputs directly to wordpress, you need your wordpress login, domain and the appliation password. Please use google to find out how to make an application password if you're not familiar with it. You can leave the post_status as draft unless you want to publish them without review, in which case the status needs to be set to publish

You have the option to change the temperature and model for OpenAI, change them if you know what you're doing or just leave them as they are.

Like we say in the south of India, Yenjaai !
I am trying to download the .exe but I get this page:
download.png

Great thread, read it all

also, how about Pinterest automation? do you have any script for that?
 
Back
Top