Skip to content

Instantly share code, notes, and snippets.

View ice2heart's full-sized avatar

Ice2heart ice2heart

View GitHub Profile
#!/bin/bash
#0 */2 * * * /home/jenkins/expire.sh # in crontab -e
DIR=/home/ice/tmp/56866493
FILES="*.mp4"
let "EXPIRETIME=172800" # expire time in seconds
cd $DIR
for f in $FILES
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
require 'rss/2.0'
require 'cgi'
require 'net/http'
host = Net::HTTP.new('bash.im', 443)
host.use_ssl = true
resp = host.get('https://bash.im/rss/')
data = resp.body
parsed = RSS::Parser.parse(data.gsub(/\<hr\>/, '<hr/>'), false)
parsed.items.each { |x| puts CGI::unescapeHTML(x.description.gsub("\n", "").gsub("<br>", "\n")); puts "%\n" }