Automate checking whether the Pinecil is still in stock
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:
import requests as r
from tkinter import messagebox as m
import tkinter as tk
import os

url = ""

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

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", message="please check your internet connection")

if("[Out of Stock]" in source[startIndex:endIndex]):
    m.showinfo(title="OUT OF STOCK", message="the Pinecil is stil out of stock, unfortunately")
    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

the only thing left then is to add a menu item with the command:
python ~/
(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
haha! this is awesome. i'd happily alter that and point people to it for the pbp, tab, and phone, too Big Grin
Hi. I'm not a python programmer. But I made a couple of small changes for Linux.

up the top put the following for direct execution. Assuming that's where you can find your python

and this down the bottom. replacing firefox with xdg-open to be a little more generic:
os.system("xdg-open "+url)

In my case it opens a tab in chromium because it's my default browser.

don't forget to chmod +x if you want to run the file directly.

e: Thanks again for posting. I just got the basics of your program running in MicroPython on an eap32. So I now have the basis of a standalone in-stock alert.
(02-01-2021, 08:45 PM)ImmortanJoe Wrote:

os.system("xdg-open "+url)
Those are good changes, I didn't really give machine independence a lot of thought when I wrote it.
I'm glad that this could serve as a basis, your project sounds really cool
Any rumor as to when the next will go on sale?

Possibly Related Threads…
Thread Author Replies Views Last Post
  Another sudden Pinecil death falk 0 205 04-30-2021, 02:27 PM
Last Post: falk
  Dead short on the power input of the Pinecil m42uko 7 1,198 04-05-2021, 02:25 PM
Last Post: tllim
  Pinecil Troubleshooting dlegs 0 168 04-04-2021, 09:18 PM
Last Post: dlegs
Video Pinecil power cycling MarMed 0 127 04-04-2021, 06:17 PM
Last Post: MarMed
  Pinecil rattle? Timpanogos Slim 2 614 03-26-2021, 01:10 AM
Last Post: Haulien
  Screen is blank on pinecil - did I kill it? ch5richards 0 329 03-12-2021, 11:31 AM
Last Post: ch5richards
Exclamation Where can i get spare parts for a damaged Pinecil? y2ktibltd 0 435 02-13-2021, 01:54 PM
Last Post: y2ktibltd
  Dead pinecil joelspangler 3 667 02-12-2021, 06:40 AM
Last Post: zer0sig
  Asus laptop power supply can also power Pinecil biketool 0 336 02-12-2021, 04:33 AM
Last Post: biketool
  DOA Pinecil? foobarney 7 1,072 02-10-2021, 05:28 PM
Last Post: foobarney

Forum Jump:

Users browsing this thread: 1 Guest(s)