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 string | |
import requests | |
import json | |
alphabets = list(string.ascii_lowercase + "åäö") | |
def crawl_with_prefix(alphabet, limit, start): | |
headers = {} # Find these from the kielitoimistonsanakirja.fi autocomplete request in browser | |
params = ( |
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
#https://pastebin.fi/p/IRfb7PacOA5B/ | |
import requests | |
from bs4 import BeautifulSoup | |
from datetime import date | |
import pandas as pd | |
import os.path | |
data_file = 'data.xlsx' | |
today = date.today() |
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
#https://pastebin.fi/p/niOTvtFJu6BI/ | |
import requests | |
import os | |
import time | |
from multiprocessing.dummy import Pool as ThreadPool | |
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'} | |
def download_file(url, local_filename): | |
# NOTE the stream=True parameter below |
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 urllib.request, json, os, ctypes | |
key = "<your_apod_api_key>" | |
bg_path = "<path_to_your_backgrounds_folder>" | |
with urllib.request.urlopen("https://api.nasa.gov/planetary/apod?api_key=" + key) as url: | |
data = json.loads(url.read().decode()) | |
file = os.path.basename(data["hdurl"]) | |
save_path = bg_path + file | |
urllib.request.urlretrieve(data["hdurl"], save_path) |
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
#https://pastebin.fi/p/Z8DF3IdYPHXX/ | |
version: "3" | |
services: | |
cloud-torrent: | |
image: jpillora/cloud-torrent | |
ports: | |
- "3000:3000" | |
volumes: | |
- "sshfsdata:/downloads" |
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
const limdu = require('limdu'); | |
const dd = new limdu.classifiers.NeuralNetwork(); | |
dd.trainBatch([ | |
{ | |
input: { | |
a: 1, | |
b: 2 | |
}, |
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
<!DOCTYPE html> | |
<html lang="fi" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Popup modaali</title> | |
<style media="screen"> | |
body { | |
margin: 0; | |
} |
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 praw | |
import time | |
import telebot | |
import threading | |
reddit = praw.Reddit(client_id="", | |
client_secret="", | |
user_agent="Free Game Finder // praw") | |
bot = telebot.TeleBot("") |
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
const http = require('http'); //Otetaan http lisäosa käyttöön | |
http.createServer(function (req, res) { //Luodaan palvelin vastaanottamaan pyyntöjä | |
http.get(req.url, (vastaus) => { //Tehdään pyyntö perustuen käyttäjän luoman pyynnön sisältävään urliin | |
let data = ''; //Luodaan vain tälle lohkolle oma data muuttuja | |
vastaus.on('data', (osio) => { //Aina kun urlista tulee dataa laitetaan se data muuttujaan | |
data += osio; | |
}); | |
vastaus.on('end', () => { //Kun datan tulo loppuu lähetetään http palvelimen avulla data. Säästetään tilaa käyttämällä vain res.endiä eikä res.writeä ja res.endiä | |
res.end(data); |
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
<!DOCTYPE html> | |
<html lang="fi" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Popup modaali</title> | |
<style media="screen"> | |
body { | |
margin: 0; | |
} |
NewerOlder