how can i create a telegram bot for save urls? - telegram-bot

it's my first bot and i'm trying to create one that save the urls send from the user
it should put the urls with /put <link/to/send/> and to fetch the url a command like /get
someone can help me for write the code? i saw a few scripts but they are not for the same purpose and i don't know from where i can start
I prefer java or python
i already tried to write a simple code for response writed inside the code, like time? and it answered with the current time

I would suggest you to use Python with dedicated libraries, here you go. https://kandi.openweaver.com/collections/python/python-telegram-bot

Related

How do i automate using Midjouney's /imagine?

I have the midjourney AI bot in my discord server (i bought it) and I want to automate a bot to use the /imagine slash command (i have a big JSON file with stuff I want it to /imagine).
maybe using a bot?!?
I prefer to use python
here is what I tried:
I tried making my bot send "/imagine ...." but it just prints it instead of using the command.
With the new slash commands, discord bots are not able to call other one's, since (unlike before) it's not actually a message that has it's contents "analysed". So you can't automatically call the MidJourney bot with yours.
But MidJourney themselves have made a wrapper, which I think you should check out for what you are trying.

Bulk text2speech Generation with R

Is it possible to loop through a list of words in R that can each be generated into separate “speech” files using the speech2text website?
https://www.text2speech.org/
To make one file manually one has to type in the text one one page then submit it. A second page then opens with the option to download the file. Since I want to do many of these I would like to find a way to automate it. I have no idea how to approach this idea though.
EDIT
So I am using "say" on mac based on a the helpful comments. I am running it through R using a loop for all strings in a vector
for(i in 1:nrow(test[1:5])){
system("say", intern =F,input = test$English[i])%>%saveRDS(paste0("/Users/Desktop/tts/", test$English[i],".aiff"))
}
This creates the files as expected in the expected location but the .aiff files won't play in any media player. Does anyone see what I am doing wrong?
Consider using a CLI based solution for TTS, like espeak/espeak-ng (cross-platform), festival (linux), say (osx) or via powershell on windows (here's a script). Looks like the page you're referencing is using flite, which is a lightweight (and downloadable) version of festival.

karate api test: how to store all responses of a feature file in an array [duplicate]

Using Karate i am making API calls sequentially. I need to store API request and response for this sequential flow of APIs in separate text files for each API call.
Need to understand how can i achieve this.
I have tried logback which stores entire execution logs in a text file.
Take a look at karate.prevRequest which will give you the "request". Now use some custom Java (or JS) code and write whatever you want to a file.
I think personally it is un-necessary because Karate's HTML report has all that you need. If someone is asking you to do this, please try convince that person that this exercise is a waste of time.

CloudConnect: Dynamic URL in REST Connector

What is the best way to create a dynamic request URL for the REST Connector in CloudConnect?
e.g. I want the URL to be for example www.myservice.com/api/{todays-date}/report.json and the URL must change accordingly everytime the ETL runs.
Is there some way to make this happen by code in CloudConnect? I didn't find any straight forward way but I found that one might be able to import a remote file containing the URL.
Does anyone have experience or tips on this subject?
what should work the best is to generate this parameter (e.g. in Data Generator) or read some data from the source (e.g. list of IDs) and send it to the REST component as an input parameter (e.g. metadata field name is 'today_date', so use ${today_date}). As far as I know this should work.
Another option is to use a parameter from a *.prm file (like workspace.prm). You can use ${PARAMETER_NAME} in your URL and this should also work correctly.
Hope this helps.
Radek

CasperJS: Disable remote page's javascript but still use casper.evaluate?

Thanks for reading my topic, I'd be really grateful if anyone could suggest any other avenues I should explore to achieve the below.
Using CasperJS or PhantomJS I need to disable all JavaScript that belongs to the pages I navigate from being executed, while still being able to run my own using casper.execute.
Does anyone know a way I can do this?
Is it possible to modify the HTTP headers or bodies using onResourceRequested or onResourceReceived? or cancel a request conditionally? or are they read only?
Can you modify the raw HTML source before it's offered for parsing?
I've tried hacking a window.stop() in a casper.execute early, but this works inconsistently between pages.
Is the Phantom WebServer module used for this kind of thing? Could/Should I route reqs/responses through that and modify them as they pass through?
Thanks for any help - I appreciate this is a weird use case.
As stated here it is possible but not with the current phantomjs master branch but in a specific [dev branch[(https://github.com/Vitallium/phantomjs/tree/allow-to-disable-js), you should build from, look for the latest commit for disable-javascript option.