Dear Igor Brigadir:
Wow, thank you very much. That indeed could make a lot of sense.
OK, so my problem was that I was emulating a code standard no longer supported in the V2 API. Forgive me. I’m trying to learn by emulating tutorials on the Internet, and of course they could be out of date. However, what I have been looking at is only 1 or 2 years old, so I thought I was safe.
Igor, what I need THE Python Language Reference Manual acceptable to Twitter V2 API. If someone could just point me to that, I will devour it into my being
Secondly Igor, where can I find then some tutorials written in Python that adhere to this Twitter V2 API. For me, all programming languages are the same, but only differ in syntax. I am hoping to find an Python tutorial example that creates a bot. Once I have this, I can start coding. I can follow and replicate the example to create a bot.
This is what I would like to do. I want to create a bot which will publish a Tweet. Here are objectives of that bot:
(1) Establish the API environment.
(2) Instead of passing parameters, I want this bot to simply get the parameters from a table like this:
all_parameters = open(‘parameterdata’,‘r’).read().splitlines
video_title = all_parameters(0);
video_URL = all_parameters(1);
author_name = all_parameters(2);
Now, Igor I don’t know if the lines of code I just wrote are V1 or V2 API, so just accept it as pseudo code.
Then I want to process these steps:
(1) Create and display an Image Card: I need to do all this in the V2 syntax. Look I really know nothing of V1 vs V2, because I have not used either. But my intent is to display first a nice header image, the width of Twitter likely 500x90px in size, as a standard header. I would like to use *.gif, because then it can be quietly animated.
def generate_card(data):
pic = Image.Open(“Header.gif”.resize((500,90), Image.ANTIALIAS))
return pic
(2) Display withing the Tweet the Video_title plus at the end the word “ by: “ and the publisher’s name.
(3) Create now a Player.Card, and display the video using the video_URL parameter.
(4) Create a Branch Button, entitled “More …”, that will take the user to FreeUkraine.Gives for ‘more” videos.
If the user, clicks the video, then they see it. Alternately, I could display just a large thumbnail of the video, which if clicked would then take the visitor back to FreeUkraine.Give to see the video in a beutiful elegant Window. With this alternate approach, I then would not need the “More…” button because once the user saw and finished his first video, suddenly he would find himself already in the midst of thousands of the same high quality all pertaining to Ukraine, the news, and how to stop this war.
This is the sum total of Player Card to play the video, if the Tweet does not automatically first send them to FreeUkraine.Gives to immediately display the video (far better a display of the video that they would otherwise see anywhere)…
I will use this bot at FreeUkraine.Gives to create a Tweeter bach in the morning and evening batch for each new news video published by FreeUkraine.gives. during those 12 hour periods of time.
These Tweets will be created twice daily at 6AM and 6PM. The batch program that will create the list for either batch will be a Winforms program, that will write out the “all_parameters” file for each video one at a time. Having written out this file, the WinForms program will then call a Process, which will then run the Python bot for each video.
In this way, a Tweet will be created for each video, where users can click the “More…” button to discover and bring them back to FreeUkraine.Gives (if they are not already there), the news website where they can then discover 10s of 1000s of other Ukraine news videos, likely 150 posted each and every day… The intent then of the bot will be to bring traffic to the FreeUkraine.Gives web site and raise awareness.
This is my whole intent, to create a bot that will advertise high quality news videos of what is going on in Ukraine, and produce a market of visitors who will come back to this website for their news once or twice a day.
Please if someone would please direct me to a (1) Twitter API V2 Python Language Reference Manual and to (2) a Twitter bot examples API V2 compliant, I will be one happy programmer.
Why do this, or why am I doing this? We are trying to raise awareness world wide (1) to stop a war in Ukraine, and more importantly (2) stop a likely nuclear exchange which will produce WWII and Armageddon. More than a million Ukraine have already died, but if we do nothing then list of victums could be indeed 7 billion souls, the entire human population of earth. We must do this. I have to do this. I am a priest of God, and has assigned me this project to be of help to all of us. We owe it to ourselves, and all humanity. So, if you will kindly advise me on this, I can create my bot, and together we will be saving many lives, maybe even our own. Please help me. I just need a little technical advice in how to write a Twitter bot. For God’s sake and yours
, please help.
Sincerely,
Pastor Burt