I’ve created Bot that sends notifications when PS5/GPU’s are in stock

when I have 2 weeks of holidays with no place to go and nothing to do in a lockdown situation, there is a high chance I will be working on a random project. This time it is a bot to check when GPU’s and PS5 are back in stock in online stores.

a couple of weeks ago I met my friend (completely legal! only 1 household) and we spend most of the time having no topics to talk about (as expected thanks to covid19), one of his biggest topics was: how bad is the availability situation of certain devices and Graphics Cards due to scalping problem.

So basically some bad guys are buying all the available stocks for these items and then put them for resale for a price that is many times more than the actual retail price. To them, this is reselling and they see no moral problem with it, the actual problem lays with how they acquire this stock. 

seemingly, the way they get hold of these items faster than anyone else is by using bots and automated tools! so basically they check the stores for availability of these items non-stop and then buy whatever is available in the blink of an eye, thus the only ways for consumers to be able to shop these items are:

  • Be super lucky! Open the product page at a given time where nobody else is on it!
  • Subscribe to bots (Like the one I built) to know when an item is in stock.
  • Pay a lot more than the retail price and buy from scalpers who call themselves resellers.

The idea of a bot that checks these products and lets people know when they are available seemed pretty fun to me! I’ve previously done a lot of work-related to scraping websites, doing web automation, and similar things!

So I decided to get into the business and make my own! although I could make a small amount of money for the affiliate sales I make with my bot, I was more interested in learning how to do integrations with Telegram and Discord. 

That is how InStock was born. In order to use this simply open https://instock.ml and join the respective notification channel for the product, you’re eyeing to buy! For example, you can subscribe to the Telegram or Discord channel.

How did I do it?

Basically, I have a list of products that have a relationship to a set of product links, these links can be from Amazon or other providers.

I have an instance of a browser that is controlled remotely via my code that opens these links in a small interval and checks if the item is available to be purchased. To do this I needed to write a small parser for each website that contains the logic that is needed to determine whether the product is in stock on that website or not.

Here are some of the problems I faced:

My IP is keeps getting blocked 🙁

Well, I get blocked by Amazon and some other sites from time to time! I literary below up my server IP in the first 1 week of working on the project! So I needed a cheap way of rotating my IPs. to do so I needed to create my own Proxy Provider, a simple proxy scrapper. I then try to use all those proxies in multiple async requests and then cherry-pick the ones which are functional, cache them for 30 minutes and randomly pick one for making the request.

Although this has been pretty efficient, I still sometimes have problems with Amazon showing me dog photos instead of the product page, well at least I got to know the Dogs of Amazon.

Twitter Blocking my Account!

One of the channels I use to update my visitors about stock availability is Twitter, I got blocked on Twitter by sending my first 3 automated tweets! They basically revoke the write permission from my application, which is crap! I’m now trying to contact them and argue the problem, hopefully, I can be up and running on Twitter again.

Future of instock.ml

So far I’ve been enjoying dealing with the challenges I have while scraping. I will definitely be working on making this better and add more sources to check for stock availability. I will be keeping this project online as long as the scalping problem exists and I do not run out of money for my servers.

Well, that was pretty much it, an official blog post to call it a day. if you have checked my bot and find it interesting let me know what you think and drop me a message if you have any suggestions on what I can implement next.

Team Engagement, Randomly Pick a member in Slack

Increasing team members’ engagement in meetings & discussions can be challenging, especially since many companies are practicing work from home in response to this pandemic. It’s not hard to spot the ninja members who are quiet in most of the meetings.

Have you ever found your team in a situation where you wanted to push those quiet members to engage more often in discussions, leading a meeting, or giving a presentation? What do you usually do in such times?

Or maybe you wanted a more fun way of starting your scrum meetings by randomizing the first person who speaks?

In our case, we’ve definitely tried giving round-robin, a try. to be even more simultaneous, we’ve tried random pickings too. 

I literary can remember our PO doing a Google search for a Random Picker online to pick a name for something we were up to in a screen share. 

So last night when I finished work, I decided to make this a bit easier for us, and maybe anyone else who uses Slack in their company by creating Random Member.

Random Member is a tiny Slack application that creates a command called /random, which you can run from any channel and group chats. 

To add this app to your workspace simply open the Random Member landing page and hit Add to Slack button.

 

/random command returns a randomly picked member of the current channel

It took me one day to build and deploy Random Member, I’m looking forward to seeing it in the Slack App Directory and get your feedback!

PS: I’ve tried to make sure everything works as expected, but I’d love you to break my app. if you find any bugs please let me know to fix them. 

Integrate Stripe into ResellerClub

Stripe, with no doubt, is my favorite payment gateway of all time. I’ve been integrating many payment gateways into my clients and my own systems and so far Stripe has beaten all of them.

Thankfully ResellerClub allows you to integrate your own payment gateways for your reseller. I’ve created a simple PHP script that lets you integrate Stripe in your ResellerClub Supersite and PartnerSite.

You can use this script for free and integrate Stripe payment gateway in ResellerClub in a couple of minutes.

The script is pretty simple and I’ve included an instruction file in the zip folder. Please note I’ve just created this for personal use and decided to release it to you guys for free. 

It requires PHP >= 7.2. in the zip package, you can also find support files for nginx and IIS web servers.

Download

I’ve made a Twitter Follower Exchange App! Here is why

I am supposed to be driving around the EU right now, I’ve been planning a road trip with some friends for some months, but sadly we were late and the new wave of Corona cases beat us to it, so I decided to stay home on my holidays and write this blog post.

Well, let’s get back to the title. I’ve created a FollowNinja Twitter Follower Exchange Platform and here is the story on how it all started. 

Aside from being bored at home after my travel plans were canceled, I was thinking about the changes that the internet has gone through for the past decade. It is really different than what I used to remember.

In short, we are stuck with the set of social media services we use, where we get our daily dose of content off them. The whole idea of discovering new content and cool websites is just fading away, at least for most of us. 

The more Social media platforms advance, they become more limited, you ask how is that? Content Curation!

You’re given a chance to choose your a bunch of favorite topic, follow things you like and these sites will do such a good job on delivering both monetized and free content on those subjects, that at some point of the time, you will never look for something more. But is this what we really want? To fill up the room with things we like and believe this is all that is out there.

That is how I decided to hack something up in a couple of off days from work. a complete random follow platform that lets you be heard and makes you hear others. 

How does it Work?

Simple. follow other users without knowing them, and they will follow you back in return. The process is completely mutual, if you unfollow someone or choose to do so, they will unfollow you too. So in short it gets you a random authentic audience. 

Let me know if you joined it, if you used it and if you have any suggestions that can make it better.

 

 

 

Laravel Auth::login() doesn’t work after registration

Are you one of those Laravel developers who is having trouble authenticating their freshly created users by calling Auth::login() method? Then continue reading this.

If you are using a non-incrementing primary key for your user table, there is a high chance that you have trouble with authentication sessions in Laravel. This is especially the case when you try to authenticate the User in code right after registration.

To solve this problem you need to add the following property to your User Model. 

it is also mentioned in Eloquent docs that you need to set this property in your models if you are not using an autoincrementing primary key.