01-27-2021, 02:15 PM
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:
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:
(replace "~/checkPinecil" with the path to your saved file)
Then you can easily check whether it is available
P.s. I am aware of how useless this is, but I was bored and this is the result.
Best Regards, Julius
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)
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
Then you can easily check whether it is available
P.s. I am aware of how useless this is, but I was bored and this is the result.
Best Regards, Julius