@Slyk_ai: A Twitter bot that gives you AI generated Startups ideas
hive-139531·@noakmilo·
0.000 HBD@Slyk_ai: A Twitter bot that gives you AI generated Startups ideas
TL;DR: Write on Twitter: ´@slyk_ai give me a Hive blockchain based startup.´ and see the magic happening.  Hi Devs! these days I've been studying a lot of Python, and I've also been very passionate about the OpenAI API, who wouldn't 😅? The thing is that I had the idea to create a Twitter bot to integrate artificial intelligence with [Slyk.io](https://slyk.io), company I work for. > *Hola Devs! en estos días he estado estudiando muchísimo Python, y he estado también muy apasionado por la API de OpenAI, quién no 😅? La cosa es que tuve la idea de crear un bot de Twitter para integrar la inteligencia artificial con [Slyk.io](https://slyk.io), compañía para la cual trabajo.* With Slyk anyone can launch a startup using a template and free e-commerce and growth tools. So I said to myself "What if there was a bot that when you ask it for a Startup idea, it would answer you with an idea and also tell you how to launch it with Slyk", no doubt it would be something useful and fun, and it would also give Slyk an extra marketing 😉. > *Con Slyk cualquiera puede lanzar una startup utilizando una plantilla y herramientas de comercio electrónico y de crecimiento gratis. Así que me dije: "Qué tal si hubiera un bot que al preguntarle por una idea de Startup, te respondiera con una idea y además te dijera cómo lanzarla con Slyk", sin dudas sería algo útil y divertido, y además le daría a Slyk un extra de marketing 😉.* So I set about the task using the 'tweepy' and 'openai' modules in Python. I did some research on the OpenAI API documentation and saw that it was possible to take the request from Twitter through this platform's API (I had to request advanced access) and with the OpenAI API, I would generate a prompt as a response to this request. > *Así que me di a la tarea usando los módulos ´tweepy´ y ´openai´ en Python. Investigué un poco de la documentación de la API de OpenAI y vi que era posible tomar la petición desde Twitter a través de la API de esta plataforma (tuve que solicitar acceso avanzado) y con la API de OpenAI, generaría un prompt como respuesta a esta petición.* Aquí va el código de la función / Here goes the code of the function: ``` def reply_with_chatgpt_prompt(): # Read if the tweet ID is on the .json file to avoid make multiple posts with open("replied_tweets.json", "r") as f: replied_tweets = json.load(f) # Search on Twitter Any mention to the bot and the order "give me" for tweet in tweepy.Cursor(api.mentions_timeline).items(): username = tweet.user.screen_name tweet_id = tweet.id tweet_text = tweet.text if tweet.in_reply_to_status_id is not None or tweet_id in replied_tweets: continue if "@slyk_ai give me" in tweet_text.lower(): idea = generate_idea(tweet_text) api.update_status( f"@{username} {idea} \n\nJoin the https://ai.slyk.io community to earn $AI and redeem it to start this idea.", in_reply_to_status_id=tweet_id ) replied_tweets.append(tweet_id) # Adding the ID to the .json file with open("replied_tweets.json", "w") as f: json.dump(replied_tweets, f) #Calling the function reply_with_chatgpt_prompt() ``` After a couple of functions, the bot was up and running on a VPS I had almost endangered at HostWinds.com. After 72hrs of testing, it is now ready and in production. > *Después de un par de funciones, el bot ya estaba listo y corriendo en una VPS que tenía casi en peligro de extinsión en [HostWinds.com](https://hostwinds.com). Luego de 72hrs de pruebas, se puede decir que ya está listo y en producción.*  So if you want to test it, play with it and give me feedback, all you have to do is go to Twitter and write a tweet, for example with the following command: > *Así que si quieres probarlo, jugar con él y darme feedback, lo único que tienes que hacer es ir a Twitter y escribir un tweet, por ejemplo con la siguiente orden:* ``` @slyk_ai give me a Hive blockchain based startup. ``` The bot will respond to anything that says '@slyk_ai give me' and contains 'startup'. > *El bot responderá a todo lo que diga ´@slyk_ai give me´ y contenga ´startup´.* ## Se aceptan colaboradores / Contributors are welcome As a good hiver that I am, I couldn't do anything else but launch this project as OpenSource, so if you want to make any kind of collaboration (thanks to @ragnarokreinier for being the first) on GitHub, for that I leave you the repository link: https://github.com/noakmilo/slykai-bot > *Como buen hiver que soy, no podía hacer otra cosa que lanzar este proyecto como OpenSource, así que si quieres realizar cualquier tipo de colaboración (gracias a @ragnarokreinier por ser el primero) en GitHub, para ello te dejo el enlace del repositorio: https://github.com/noakmilo/slykai-bot* The next thing I want to do is to continue experimenting with the OpenAI API and integrate it somehow with Hive, so you'll have new news about me soon =) > *Lo próximo que quiero hacer es seguir experimentando con la API de OpenAI e integrarla de alguna forma con Hive, así que tendrán pronto nuevas noticias sobre mi =)*  <center>**Follow me at [Twitter](https://twitter.com/noakmilo) and [Instagram](https://instagram.com/noakmilo)** **Hire my services as Community Manager at [noakmilo.slyk.io](https://noakmilo.slyk.io)** **Support my content by [delegating me HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=noakmilo&vesting_shares=50%20HP)**</center>
👍 crptogeek, hiveremesas, ogre-radio, jaynie, theluvbug, tryskele, macchiata, ertytux, cryptomaso, hivecuba, lioz3018, manuphotos, jomancub, miguelgonzalezms, manuelernestogr, apoklipsix, osmy91, janetedita, abelfotografia, ditoferrer, cryptocubangirl, demoad, fabiodc, tecnologyfan1, ricardoeloy, androliuben, pumarte, chisa.gaka, kumagaro, eduardo900613, mariolisrnaranjo, jesusdiaz880924, adailsm, karelnt, daltono, elderson, flowerbaby, the13anarchist, aliento, flywithmarlin, netaterra, enrique89, nnnarvaez, cronosclocks, blocktrades.com, grisvisa, huesos, pialejoana, jacuzzi, monster-one, zeruxanime, therealyme, dimeshana, jessiparber23, palimanali, solsticia, erochka, xcu, soy-laloreto, blocktrades, alpha, netaterra.leo, drexlord, roelandp, aliento.love, waivio.curator, marblely, xblocktrades, xalpha, joeyarnoldvn, gaboamc2393, helengutier2, mayvileros, healthrecipes, brujita18, tony1294, leomarylm, jonaira, germanandradeg, anacarolina2022, maraven, naty16, juliocesardraw, javilinares, marifr, moisesmcardona, apokruphos, maxjulisgf, maxipiano78, dlizara, leomolina, marcocosta, davixesk8, librepensadora, schubertlover, suezoe, motica29, cabetosag, issymarie, mayvil, trifenix, irvet, sarix, ezerledezma, kattyart, danielapevs, magin.pintor, joseq1570, genice, jtkl12, hyun-soo, dolivero, edanya, numa26, sadbear, gersonvasquez, comunidadgenial, milyy, historiasamorlez, arnaldoropeza, anderson69, tonyhernandez41, nelsonnils, merwinrod, mjvdc, gomezmarve, nodoninja, mballesteros, elvys, ersusoficial, thevil, theycallmedan, xtheycallmedan, gaottantacinque, cribbio, gasaeightyfive, omarcitorojas, bonzopoe, amambay, appreciator, xappreciator, sunsea, myfreshes, adedayoolumide, bluemist, lenasveganliving, x30, elmundodexao, zeesh, noalys, cielitorojo, stellify, power-kappe, fotomaglys, aprasad2325, wendy0520, femcy-willcy, detlev, elgatoshawua, anikekirsten, dynamicrypto, actioncats, discoveringarni, lucianav, hexagono6, trouvaille, inciter, noelyss, quycmf8, coolsurfer, kattycrochet, thereikiforest, beerlover, eddiespino, xulax, xerox94, farpetrad,