[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Scripts thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 6
Thread images: 3

File: pasty.webm (775KB, 729x531px) Image search: [Google]
pasty.webm
775KB, 729x531px
Post your favorite scripts. Here is one of mine that searches pastebin for for posts that contain certain keywords. I made it a CLI tool because I am gunna make it search for different things depending on the language you choose. Any suggestions?
>>
>>57514030
>Russian comments
Don't let us sanction you even further. Write all of your code in proper English.
Here's my script for downloading torrents from an RSS feed.
#!/usr/bin/env python3

import os
import urllib.request
import xml.etree.ElementTree

CONFIG_FILENAME = os.path.join(os.sep, os.environ['HOME'], '.matcha')
TORRENTS_DIRNAME = os.path.join(os.sep, os.environ['HOME'], 'torrents')
HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'
}

with open(CONFIG_FILENAME, 'r') as f:
for url in f:
req = urllib.request.Request(url, headers=HEADERS)
res = urllib.request.urlopen(req)
feed = res.read()
root = xml.etree.ElementTree.fromstring(feed)
for item in root.iter('item'):
title = item.find('title').text
title = title.replace(os.sep, '-')
filename = title + '.torrent'
abs_filename = os.path.join(os.sep, TORRENTS_DIRNAME, filename)
if os.path.isfile(abs_filename):
continue
link = item.find('link').text
req = urllib.request.Request(link, headers=HEADERS)
res = urllib.request.urlopen(req)
torrent = res.read()
with open(abs_filename, 'wb') as f:
f.write(torrent)
>>
fred's imagemagick scripts
gimpscripts dot com
>>
File: booru_scraper.png (166KB, 843x832px) Image search: [Google]
booru_scraper.png
166KB, 843x832px
this multi-threaded gelbooru-API scraper that I made; still gotta extend it to support non-gelbooru-API sites though
>>
File: kek.jpg (7KB, 322x99px) Image search: [Google]
kek.jpg
7KB, 322x99px
>>
>>57514432
i dont get it.
Thread posts: 6
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.