The bot now has 5000 subscribers. It takes about one hour and a half to notify all of them, so the reddit limits are in our favour now apparently.
I will just have to implement a proper way to restart the bot when it crashes. Someone pointed me at supervisor, which I will check out now.
Hope you all had a good day :)
I will just have to implement a proper way to restart the bot when it crashes. Someone pointed me at supervisor, which I will check out now.
Hope you all had a good day :)
Forwarded from Poolitzer X
So, over the last couple of weeks I developed a bot for a closer group on telegram, with more testing and bug fixing pre-release than I've ever done. Releasing it's source to the public does not make sense at all, because it depends on a lot enclosed internal stuff. But I learned about the beauty of modules.
If you ever start scripting, you will have everything in one file. And thats cool in the beginning. But trust me when I tell you this: After you finished and want to pick up your work after some weeks, it will just look unordned, awful; its pure madness. If you however write functions, put those in fitting files and import them where needed, everything looks better and you can actually start working without having to spend half of an hour to get yourself back into your code.
Thats what I am doing now with another project of mine. It is its second rewrite, but it will be worth it
If you ever start scripting, you will have everything in one file. And thats cool in the beginning. But trust me when I tell you this: After you finished and want to pick up your work after some weeks, it will just look unordned, awful; its pure madness. If you however write functions, put those in fitting files and import them where needed, everything looks better and you can actually start working without having to spend half of an hour to get yourself back into your code.
Thats what I am doing now with another project of mine. It is its second rewrite, but it will be worth it
❤1
Over the last two days, I developed a userbot for a friend of mine, Sköll (@skollwolf).
It essentially checks if you currently play a song over spotify. If you do, the bot updates your biography accordingly with the title, interpret, the duration and how long you listen to it already. If you don't, it changes your biography back to your original one.
There are three reasons why I tell you about it:
1. This is my first project with a nice readme and comments in its code, so you can run it by yourself with little programming knowledge.
2. Spotify has a really annoying update of it's access token, which takes about 7% of my main code to deal with, but about half of my developing time - and I'm not even sure this works now. Also it of course needs its own loop. So now I'm not the only one annoyed by it, you as well, because you had to read it.
3. I really need a better name then spotify telegram bio updater for it. If you have a good idea, hit me up.
Have a great (rest) day otherwise, and here is the source code:
https://github.com/Poolitzer/spotify_telegram_bio_updater
It essentially checks if you currently play a song over spotify. If you do, the bot updates your biography accordingly with the title, interpret, the duration and how long you listen to it already. If you don't, it changes your biography back to your original one.
There are three reasons why I tell you about it:
1. This is my first project with a nice readme and comments in its code, so you can run it by yourself with little programming knowledge.
2. Spotify has a really annoying update of it's access token, which takes about 7% of my main code to deal with, but about half of my developing time - and I'm not even sure this works now. Also it of course needs its own loop. So now I'm not the only one annoyed by it, you as well, because you had to read it.
3. I really need a better name then spotify telegram bio updater for it. If you have a good idea, hit me up.
Have a great (rest) day otherwise, and here is the source code:
https://github.com/Poolitzer/spotify_telegram_bio_updater
GitHub
GitHub - Poolitzer/spotify_telegram_bio_updater: This userbot updates the biography of a telegram user according to their current…
This userbot updates the biography of a telegram user according to their current spotify playback. - Poolitzer/spotify_telegram_bio_updater
❤1
Hello guys.
New post, new project. Another reddit bot is born today: The BrandConnoisseur.
It automatically comments below posts in the r/battleofthebrands community, giving the users there the ability to vote on each "battle". The challenging parts were the cron_jobs, which means that the bot does something every x seconds (in this specific situation: getting upvotes to the bot comments so it can dtermine which brand wins the battle). This is important because old posts won't get as much attention as new ones, so it is not worth to call the API on those as often as on fresh submission. We have to work with a rather harsh request limit, so getting those to work was rather crucial. The current refresh rate (subject to change ofc):
* For the first five hours: every five minutes
* For 24 hours after that: every hour
* for a week after that: every day
* foever after that: weekly
It is a fairly new subreddit, I'm looking forward to see where it wents from here. But I played my part in getting it initially up and running.
P.S.: Source code, as always.
New post, new project. Another reddit bot is born today: The BrandConnoisseur.
It automatically comments below posts in the r/battleofthebrands community, giving the users there the ability to vote on each "battle". The challenging parts were the cron_jobs, which means that the bot does something every x seconds (in this specific situation: getting upvotes to the bot comments so it can dtermine which brand wins the battle). This is important because old posts won't get as much attention as new ones, so it is not worth to call the API on those as often as on fresh submission. We have to work with a rather harsh request limit, so getting those to work was rather crucial. The current refresh rate (subject to change ofc):
* For the first five hours: every five minutes
* For 24 hours after that: every hour
* for a week after that: every day
* foever after that: weekly
It is a fairly new subreddit, I'm looking forward to see where it wents from here. But I played my part in getting it initially up and running.
P.S.: Source code, as always.
Reddit
r/battleofthebrands
Compare and Contrast various aspects of Brands or Products.
Fun is fun, but who needs that. I will be at my PC.
Take an amazing sentence from Rick & Morty (S02E03), slightly alter the place and you have me irl :)
Take an amazing sentence from Rick & Morty (S02E03), slightly alter the place and you have me irl :)
🔥1
Hey guys.
I am starting a five day vacation from nothing (since I currently have education free time. Im still at my school but dont have to attend, so I could prepare for my final exams). My class decided to take one last trip together - we booked a house in Denmark and will be there the next five days. I dont know how the internet coverage will be, so I may respond later then usually to queries :)
I am starting a five day vacation from nothing (since I currently have education free time. Im still at my school but dont have to attend, so I could prepare for my final exams). My class decided to take one last trip together - we booked a house in Denmark and will be there the next five days. I dont know how the internet coverage will be, so I may respond later then usually to queries :)
And with these generic shots I could have taken anywhere (they are from Denmark though, I swear) is my vacation over. It was nice. I also enjoy having my PC back though, getting back to work.
Today quite a lot happend:
• I finished my "A levels" with a spoken exam. So I finished school. I got an average grade of 2,2!
• I almost finished a rewrite of bot project which I had laying around since at least November. This current version will probably go into "production" and has some features which you may encounter later in your life as well, at least if you visit the telegram support groups :) The difference between this version and the one before the rewrite shows how much I learned with modules and functions, which is amazing. The bot has quite a lot to do behind the scenes, we end up with 1.800 lines of code. Still can't believe it just works.
• I had a meeting for the two weeks sailing I will do in two weeks. I did this three times already and really look forward to it again. I also got a free T-Shirt and a pullover, so thats nice.
• I finished my "A levels" with a spoken exam. So I finished school. I got an average grade of 2,2!
• I almost finished a rewrite of bot project which I had laying around since at least November. This current version will probably go into "production" and has some features which you may encounter later in your life as well, at least if you visit the telegram support groups :) The difference between this version and the one before the rewrite shows how much I learned with modules and functions, which is amazing. The bot has quite a lot to do behind the scenes, we end up with 1.800 lines of code. Still can't believe it just works.
• I had a meeting for the two weeks sailing I will do in two weeks. I did this three times already and really look forward to it again. I also got a free T-Shirt and a pullover, so thats nice.
Pool talks
Today quite a lot happend: • I finished my "A levels" with a spoken exam. So I finished school. I got an average grade of 2,2! • I almost finished a rewrite of bot project which I had laying around since at least November. This current version will probably…
Hey guys.
Remember the last point here? It essentially means for you that I wont be online at all for two weeks, starting at saturday morning (29th, so in like three days).
If you have unfinished business with me I forgot about, now would be the perfect time to ping me.
Remember the last point here? It essentially means for you that I wont be online at all for two weeks, starting at saturday morning (29th, so in like three days).
If you have unfinished business with me I forgot about, now would be the perfect time to ping me.
Long time no post, hu.
Im a bit busy with several things. Mainly preparing my Canada year which will start in 4 days with a flight to Manchester, 12 hours doing nothing, and then flying from there to Vancouver. Once there, if I get quickly enough through everything, I may make it to a Canada Service Center in time where I can get my Social Identity Number, which you need for almost everything there. If I get it, I can get myself a local bank account, and then well, start having a good time and find some work :D
I still need to book a hostel or smth like this where I can stay for the time being, and I need a job. Will see how that works out.
On an unrelated note, I am currently rewriting an API wrapper I started months ago with. It is looking good and I overcome some technical challenges while still having to fight some more, but the main problem is that an API wrapper is soooo boring, its unbelievable. Most of the time I'm just building objects and its so. Much. Boring. Work. Will take this with me and continue working on it in Canada I guess. https://github.com/Poolitzer/kanka/tree/rewrite, if you want to have a look at it (and may give me some feedback)
On another unrelated note, its my birthday today and I had a great start into it with my family, because all of my friends are on vacation (how dared they 😱). Will visit my grandmother later though and just continue having a good time with my family.
Edit: cant type.
Im a bit busy with several things. Mainly preparing my Canada year which will start in 4 days with a flight to Manchester, 12 hours doing nothing, and then flying from there to Vancouver. Once there, if I get quickly enough through everything, I may make it to a Canada Service Center in time where I can get my Social Identity Number, which you need for almost everything there. If I get it, I can get myself a local bank account, and then well, start having a good time and find some work :D
I still need to book a hostel or smth like this where I can stay for the time being, and I need a job. Will see how that works out.
On an unrelated note, I am currently rewriting an API wrapper I started months ago with. It is looking good and I overcome some technical challenges while still having to fight some more, but the main problem is that an API wrapper is soooo boring, its unbelievable. Most of the time I'm just building objects and its so. Much. Boring. Work. Will take this with me and continue working on it in Canada I guess. https://github.com/Poolitzer/kanka/tree/rewrite, if you want to have a look at it (and may give me some feedback)
On another unrelated note, its my birthday today and I had a great start into it with my family, because all of my friends are on vacation (how dared they 😱). Will visit my grandmother later though and just continue having a good time with my family.
Edit: cant type.
GitHub
GitHub - Poolitzer/kanka at rewrite
Contribute to Poolitzer/kanka development by creating an account on GitHub.
The day has come, the time is here. In a few hours (depending on the delay of my flight), I am flying to Manchester.
What will happen to me? Dont know yet ;P
What can you expect from this channel? Weekly posts \o/. At least thats what I am going to aim for. I will start at the local friday (in, uhm. Like 30 hours maybe?) and will try to make one post every week, with a cool hashtag so you can find them easily.
So yeah, that year is about to begin. Wuhu.
What will happen to me? Dont know yet ;P
What can you expect from this channel? Weekly posts \o/. At least thats what I am going to aim for. I will start at the local friday (in, uhm. Like 30 hours maybe?) and will try to make one post every week, with a cool hashtag so you can find them easily.
So yeah, that year is about to begin. Wuhu.
#canadayear - week 0
I did not expect to be able to write that much, considering this "week" is only about 30 hours long.
I started with a flight from Hamburg to Manchester, where the flight had an hour delay. Finally reaching Manchester, I got my luggage and were 12 hours in the airport. I arrived at 23 local time maybe, so there was no sense in seeing a sleeping city (and not enough time either for getting there and back), so I stayed. I had a wonderful time there, talking the first four hours with two other passengers, who then took earlier flights though. And then a nice mix of trying to sleep on chairs and short conversations with other people.
Somehow, this time passed and I went to check-in with my flight to Vancouver asap, because my backpack was annoying to carry around. I ended up having to fill another two hours or so, but I had my Nintendo Switch with me and soon a Mario Cart round with some other waiting people. That was fun and a bit challenging.
The flight to Vancouver was boring, I slept three hours overall, got two meals and watched some movies. Nothing special.
The Vancouver International Airport is beautiful, compared to Hamburg and Manchester. My luggage took its time to arrive, and then I had to wait really long until the immigration officier gave me my work permit, but I got it without problems. Then I made my way to the flat I am in, and will fall asleep soonish I guess. My host is a very interesting person, whose english is worse then mine, but we manage. Somehow. I still dont know how to get into the flat on my own, but thats not my problem now. First thing in the morning I guess.
I did not expect to be able to write that much, considering this "week" is only about 30 hours long.
I started with a flight from Hamburg to Manchester, where the flight had an hour delay. Finally reaching Manchester, I got my luggage and were 12 hours in the airport. I arrived at 23 local time maybe, so there was no sense in seeing a sleeping city (and not enough time either for getting there and back), so I stayed. I had a wonderful time there, talking the first four hours with two other passengers, who then took earlier flights though. And then a nice mix of trying to sleep on chairs and short conversations with other people.
Somehow, this time passed and I went to check-in with my flight to Vancouver asap, because my backpack was annoying to carry around. I ended up having to fill another two hours or so, but I had my Nintendo Switch with me and soon a Mario Cart round with some other waiting people. That was fun and a bit challenging.
The flight to Vancouver was boring, I slept three hours overall, got two meals and watched some movies. Nothing special.
The Vancouver International Airport is beautiful, compared to Hamburg and Manchester. My luggage took its time to arrive, and then I had to wait really long until the immigration officier gave me my work permit, but I got it without problems. Then I made my way to the flat I am in, and will fall asleep soonish I guess. My host is a very interesting person, whose english is worse then mine, but we manage. Somehow. I still dont know how to get into the flat on my own, but thats not my problem now. First thing in the morning I guess.
#canadayear - week 1
Yeah, getting in the flat is no problem once I got a key :)
I spend the days having vacation in Vancouver basically. I took the bus to several places: Saturday Downtown, I went to Granville Island, then got myself a bike and went through the Stanley park. In the evening at 20:00, there were fireworks I attended. Sunday I got to Kitsilano Beach, hoping to find other people to play Volleyball with which I did pretty easily. Then I went to Glastown and back home.
Monday morning I tried to get my SIN number, which didnt work out because there were public holidays I didnt know of. So I went to the Science Museum which was very close and had a blast there.
Tuesday I got my SIN number and banking account, went tp buy myself a belt (which I forgot at home) and a powerbank. Then I visited a bit of Richmonds parks.
Wednesday, I went to Marks to get myself working clothes as preparation for my next weeks, working on a farm. I also went to long beach and got myself into some volleyball games again.
Thursday, I went to Pacific Spirit regional park and run around there, but most of the time I spent packing my bagpack and so.
Friday, I left pretty early to catch a ferry. The bus was even earlier (10 minutes ahead of schedule) and left while I arrived at the station, so now I am sitting here at a random ferry terminal with wifi and well, guess I can visit long harbour at salt spring island soonish :)
In general, I got the feeling that Canadians are way nicer then Germans. Almost no one wears headphones in public, almost always eager to start a conversation with a random stranger. On the fireworks night, I talked with an Asian women and her child a lot, we both thought that our conversation partner would live here. On the way back with a chanting hippie + his guitar, I got to chat with some other people, its awesome. The ticket system on the bus is based on tickets you hold against a little panel, and everytime the ticket from a person was denied, the bus driver always let them though, despite you could also just pay money.
Also, a big shout out to Google maps for existing. Makes life way easier.
Till next week I guess
P.S.: Im no big photographer, but if I got internet tonight, I will send some pictures :)
Yeah, getting in the flat is no problem once I got a key :)
I spend the days having vacation in Vancouver basically. I took the bus to several places: Saturday Downtown, I went to Granville Island, then got myself a bike and went through the Stanley park. In the evening at 20:00, there were fireworks I attended. Sunday I got to Kitsilano Beach, hoping to find other people to play Volleyball with which I did pretty easily. Then I went to Glastown and back home.
Monday morning I tried to get my SIN number, which didnt work out because there were public holidays I didnt know of. So I went to the Science Museum which was very close and had a blast there.
Tuesday I got my SIN number and banking account, went tp buy myself a belt (which I forgot at home) and a powerbank. Then I visited a bit of Richmonds parks.
Wednesday, I went to Marks to get myself working clothes as preparation for my next weeks, working on a farm. I also went to long beach and got myself into some volleyball games again.
Thursday, I went to Pacific Spirit regional park and run around there, but most of the time I spent packing my bagpack and so.
Friday, I left pretty early to catch a ferry. The bus was even earlier (10 minutes ahead of schedule) and left while I arrived at the station, so now I am sitting here at a random ferry terminal with wifi and well, guess I can visit long harbour at salt spring island soonish :)
In general, I got the feeling that Canadians are way nicer then Germans. Almost no one wears headphones in public, almost always eager to start a conversation with a random stranger. On the fireworks night, I talked with an Asian women and her child a lot, we both thought that our conversation partner would live here. On the way back with a chanting hippie + his guitar, I got to chat with some other people, its awesome. The ticket system on the bus is based on tickets you hold against a little panel, and everytime the ticket from a person was denied, the bus driver always let them though, despite you could also just pay money.
Also, a big shout out to Google maps for existing. Makes life way easier.
Till next week I guess
P.S.: Im no big photographer, but if I got internet tonight, I will send some pictures :)