DEV Community


Posted on • Updated on


Pick Random Item From Shop Based On How Much Money You Got

github action hackathon is hackathon created by i won as a runner up here as spiritbro1

My Workflow

So background of the story is, i recently participated in hackathon called web monetization hackathon and i didn't win so 😢, but thank God give us another exciting hackathon that i recently learn also by making a covid telegram notification using github action you can check that out here

and most importantly is generous enough to gave me some credit to spend on shop Thank You Team!! 😃 but the problem is i dont know which item i want to get from shop so why dont we make a github action that can get us some random item from shop. So let's begin.

So since doesnt have api to get the item and the price tag i need to scrape the shop and save it to csv i use csv coz it is much faster than setting up a whole new database you can take a look the code here:

last scraped in 17-9-2020

List of item scraped from devto shop

no image url title price
1 CodeLand Mug $ 14.0
2 CodeLand Tote bag $ 23.0
3 CodeLand Magic Mug $ 14.0
4 CodeLand Fanny Pack $ 35.0
5 CodeLand Flip-Flops $ 18.0
6 Embroidered DEV Champion Bomber Jacket $ 65.0
7 Embroidered DEV Backpack $ 50.0
8 DEV Tee Unisex (Multiple Colors) $ 18.0
9 DEV Hat (Multiple Colors) $ 27.0
10 May The Source Be Open Sweatshirt $ 42.0
11 Black DEV Beanie $ 19.0
12 JavaScript DEV Unisex $ 18.0
13 Vintage DEV Hat $ 27.0
14 Sticker Pack $ 12.0
15 Gift Card $ 10.0
16 Pom Pom DEV Hat (Multiple Colors) $ 19.0
17 Space DEV Tee Unisex (Multiple Colors) $ 27.0
18 DEV Crewneck Unisex

so what this does is, it scrape all item in shop and the price tag and put it to the csv in github repo there, so i create a python app to scrape all the item in and after that we get the raw csv from that python app then we create a github action that can randomly generate markdown with the item that randomly generated from shop for us, this github action will create a new file called so it is basically can work with any repo if you just want to play with it. And doesn't disrupt an already created

Step by Step how to use this github action

  1. create a repo

  2. create a yaml file example here

  3. let it run until finished like this


  1. after that you get a new branch called "devto-shop-random-generator" compare that branch and pull request


click "create pull request"


then click "merge pull request"


then click "confirm merge"


you will get a new markdown file called "" click that


and then VOILA!! you will get your random item like this that you can buy based on your budget


take a note that this budget is not included with shipping payment coz it will vary based on your country

Submission Category:

Wacky Wildcards

Yaml File or Link to Code

GitHub logo spiritupbro / devtoshop-random-generator

runner up hackathon


this action get you a random item that you can buy on a budget from shop

You can see the explanation here

Required argument

  • budget your budget in us dollar
  • personal_token to create a branch and pull request
  • github_repo your repo name

Example Yaml

# This is a basic workflow to help you get started with Actions
name: Get Random Item from

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
    branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
  # This workflow contains a single job called "build"
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Example repo that use this github action

Top comments (1)

spiritupbro profile image

(commentspiritbro1english) github action hackathon is hackathon created by i won as a runner up here by creating a github action that can get you random item from based on your budget

50 CLI Tools You Can't Live Without

>> Check out this classic DEV post <<