Automate checking whether the Pinecil is still in stock
#6
(01-27-2021, 02:15 PM)Julius_GU Wrote: 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
updated it so it also knows if something will be back soon also any browser will work now 

Code:
import webbrowser as web
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"

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")
elif("[Schedule back in stock " in source[startIndex:endIndex]):
    print(source[startIndex:endIndex])
    m.showinfo(title="OUT OF STOCK", message="the Pinecil is scheduled to be back in stock")
else:
    choice = m.askquestion(title="IN STOCK", message="THE PINECIL IS BACK\nGo to the store?")
    if choice == 'yes':
        web.open(url, new=0, autoraise=True)
  Reply


Messages In This Thread
RE: Automate checking whether the Pinecil is still in stock - by ender__exe - 08-23-2022, 12:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pinecil v2 dosent negotiate power moses 0 831 07-07-2026, 07:28 AM
Last Post: moses
  Pinecil low temp mods? davidcoley 0 747 06-21-2026, 02:53 AM
Last Post: davidcoley
  my pinecil v2 is not working jagrav 0 1,135 04-17-2026, 06:28 AM
Last Post: jagrav
  Pinecil V2 doesn’t power on under any circumstances BigCarrotLeaf 1 3,227 03-28-2026, 02:37 AM
Last Post: Juptin
  Pinecil v2: Use car battery for power? FZB 0 1,141 03-02-2026, 09:56 AM
Last Post: FZB
  Is Vector3d.shop a legitimate pinecil reseller? jamespo 0 1,527 12-03-2025, 07:40 AM
Last Post: jamespo
  Minimum temperature Pinecil pschalkwijk 1 1,936 10-16-2025, 10:40 PM
Last Post: tllim
  Pinecil v2 not reaching 20v … Escape75 0 4,899 09-23-2025, 09:25 PM
Last Post: Escape75
  Pinecil v2 tip screw temperature Minuen 0 9,737 06-23-2025, 06:38 AM
Last Post: Minuen
  Crippling noise from inside pinecil during a few minutes high power soldering. dreieck 3 6,314 05-15-2025, 10:41 AM
Last Post: dreieck

Forum Jump:


Users browsing this thread: 1 Guest(s)