This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ui version="4.0"> | |
<class>MainWindow</class> | |
<widget class="QMainWindow" name="MainWindow"> | |
<property name="geometry"> | |
<rect> | |
<x>0</x> | |
<y>0</y> | |
<width>526</width> | |
<height>373</height> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_for_airpods(timeout=60): | |
import time;import os;import requests;import arrow | |
while True: | |
status = requests.get("https://www.apple.com/de/shop/retail/pickup-message?parts.0=MMEF2ZM%2FA&location=81925").json()['body']['stores'][0]['partsAvailability']['MMEF2ZM/A']['storePickupQuote'] | |
available = 'Aug im' not in status | |
if available: | |
os.system(""" osascript -e 'display notification "{}" with title "Apple Store AirPods"'""".format(status)) | |
else: | |
print(f"Last checked at {arrow.now().format('YYYY-MM-DD HH:mm')}, status= {status}", end="\r") | |
time.sleep(timeout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sqlite3 | |
import os | |
# API key available at: http://trakt.tv/api-docs/authentication | |
API_KEY = "25665d450ed0c00907f32be617cd2a37" | |
TRAKT_USER = "nikolak" # trakt username | |
TRAKT_URL = "http://api.trakt.tv/user/library/shows/all.json/{key}/{user}".format( | |
key=API_KEY, | |
user=TRAKT_USER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def letter_count(s): | |
counter, max_index = 1, len(s) - 1 | |
out = [] | |
for index, letter in enumerate(s): | |
if index < max_index: | |
if letter == s[index + 1]: | |
counter += 1 | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plugin import CommandPlugin | |
class test(CommandPlugin): | |
self.add_commands({"test":self.test()}) | |
def test(self, user, channel, parameters): | |
print "executing test command" | |
self.bot.msg(channel, "Test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import json | |
import time | |
import urllib | |
import httplib2 | |
from urllib import urlencode | |
from urlparse import urlparse, urlunparse, parse_qs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import sqlite3 | |
import datetime | |
#TO-DO: | |
#Fix a few user options...I think like 1-3 or something. | |
# | |
conn = sqlite3.connect('moviedb.db') | |
c = conn.cursor() | |
class Movie(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import time, sleep | |
import requests | |
import logging | |
import json | |
# submission dict layout initial idea | |
# {"id": { | |
# time:{ #unix timestamp, str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removed_counter=0 | |
for x in range(0,len(to_update),100): | |
items=to_update[x:x+100] | |
items_url=api_by_id.format(",".join(items)) | |
request_time=time() | |
print "[FILTERING] Starting request...",request_time | |
# print "Request url", items_url | |
try: | |
r=requests.get(items_url, headers=headers, timeout=20) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import time | |
import json | |
import urllib2 | |
def get_submissions(): | |
url="http://www.reddit.com/r/all/new/.json" #URL of the page that we want to fetch | |
headers = { 'User-Agent' : 'fetching new submissions script' } # our script "identifier" | |
req = urllib2.Request(url, None, headers) # We create new request here to open the url with above set headers | |
data = urllib2.urlopen(req).read() # Open url and make data variable equal whatever we get |