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
  Connecting a power supply to the Pinecil jon_bondy 1 352 02-29-2024, 07:37 PM
Last Post: Okedokey
  Crippling noise from inside pinecil during a few minutes high power soldering. dreieck 2 772 01-31-2024, 12:34 AM
Last Post: suga7
Question Pinecil Tempaerature Reading jumps to Y400°C when active but stays normal when cold H3wastooshort 0 362 12-24-2023, 05:45 PM
Last Post: H3wastooshort
  Asus laptop power supply can also power Pinecil biketool 9 8,234 11-17-2023, 12:57 PM
Last Post: killingmesmalls
  Mass problem Pinecil V2 Harrysteed 0 655 11-02-2023, 09:11 AM
Last Post: Harrysteed
Question Pinecil v2 power cycles at higher voltages? clemon79 2 1,278 10-09-2023, 10:10 PM
Last Post: clemon79
  PD resets during heat up tip [Pinecil V2] Neitron4ik 2 1,544 10-09-2023, 01:22 AM
Last Post: Neitron4ik
  [Hackaday Article] All About USB-C: Pinecil Soldering Iron vajak 1 1,437 02-02-2023, 11:45 AM
Last Post: VaZso
  Brand new Pinecil v2 won't boot on PD jhutch 1 2,237 12-14-2022, 01:03 AM
Last Post: River
  Survey on Pinecil Tips, Please fill out River 0 1,251 11-06-2022, 02:43 AM
Last Post: River

Forum Jump:


Users browsing this thread: 1 Guest(s)