Skip to content

Instantly share code, notes, and snippets.

@xcodebuild
Last active October 12, 2016 03:43
Show Gist options
  • Save xcodebuild/c2b4fbf7bee58046f70f35e6d9058598 to your computer and use it in GitHub Desktop.
Save xcodebuild/c2b4fbf7bee58046f70f35e6d9058598 to your computer and use it in GitHub Desktop.
Update MEOW config with free shadowsocks provider
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import re
import os
from os.path import expanduser
url = "http://freevpnss.cc/"
page = urllib.urlopen(url).read()
r = re.compile('码:\d+')
sspw = r.findall(page)[3].lstrip('码:')
configfile = open(expanduser('~/.meow/rc'), 'r+')
lines = configfile.readlines()
config = 'proxy = ss://aes-256-cfb:%s@us.ioss.pw:443' % sspw
lines = ['' if line.startswith('proxy') else line for line in lines]
lines.append(config)
configfile.seek(0)
configfile.truncate()
configfile.writelines(lines)
configfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment