Automate checking whether the Pinecil is still in stock
#1
Big Grin 
Here is a quick way to see whether the Pinecil gets back in stock.
I've been meaning to get one, but it is out of stock. To automate my stalking of pine's website, i've written this python script and thought that I could share it if someone thinks that it's neat:
Code:
import requests as r
from tkinter import messagebox as m
import tkinter as tk
import os

url = "https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/?v=0446c16e2e66"

#don't show a main window
root = tk.Tk()
root.withdraw()

response = r.get(url)

source = response.text

startIndex = source.find("<title>")
endIndex = source.find("</title>")

if (startIndex == -1) or (endIndex == -1):
    m.showerror(title="could not check pine64.com", message="please check your internet connection")
    quit()

if("[Out of Stock]" in source[startIndex:endIndex]):
    print(source[startIndex:endIndex])
    m.showinfo(title="OUT OF STOCK", message="the Pinecil is stil out of stock, unfortunately")
else:
    choice = m.askquestion(title="IN STOCK", message="THE PINECIL IS BACK\nGo to the store?")
    if choice == 'yes':
        os.system("firefox "+url)
This will show the following when executed
https://ibb.co/XzLBd1P
https://ibb.co/XCcJb9D

the only thing left then is to add a menu item with the command:
Code:
python ~/checkPinecil.py
(replace "~/checkPinecil" with the path to your saved file)

Then you can easily check whether it is available Smile

P.s. I am aware of how useless this is, but I was bored and this is the result.

Best Regards, Julius
  Reply


Messages In This Thread
Automate checking whether the Pinecil is still in stock - by Julius_GU - 01-27-2021, 02:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Minimum temperature Pinecil pschalkwijk 0 73 10-12-2025, 03:14 AM
Last Post: pschalkwijk
  Pinecil v2 not reaching 20v … Escape75 0 3,818 09-23-2025, 09:25 PM
Last Post: Escape75
  Pinecil v2 tip screw temperature Minuen 0 8,391 06-23-2025, 06:38 AM
Last Post: Minuen
  Crippling noise from inside pinecil during a few minutes high power soldering. dreieck 3 3,869 05-15-2025, 10:41 AM
Last Post: dreieck
  Pinecil v2 issue autumnharris 0 909 05-15-2025, 01:35 AM
Last Post: autumnharris
  Pinecil V2 doesn’t power on under any circumstances BigCarrotLeaf 0 1,366 03-22-2025, 07:29 AM
Last Post: BigCarrotLeaf
  Pinecil constantly cutting out WroughtIron 1 2,071 01-16-2025, 02:20 AM
Last Post: D4veC4rter
Exclamation Pinecil is working with 5v but nothing else!! MizterPink 1 1,410 01-07-2025, 03:59 PM
Last Post: MizterPink
  Pinepower suitable for an s23 (and a pinecil) its_lieseeeee 0 1,148 12-09-2024, 01:41 PM
Last Post: its_lieseeeee
  Help with Pinecil saranelson 1 1,654 11-09-2024, 02:19 PM
Last Post: biketool

Forum Jump:


Users browsing this thread: 1 Guest(s)