python脚本,用于将twitter配置文件横幅设置为来自指定文件夹或路径列表的随机图像。
twitter-banner-switcher的Python项目详细描述
python(3)脚本,将twitter个人资料横幅设置为随机的 来自指定文件夹或路径列表的图像。
安装
使用PyPI(推荐):
$ pip3 install twitter-banner-switcher
使用git clone:
$ git clone https://github.com/Pythonity/twitter-banner-switcher
$ pip3 install -r twitter-banner-switcher/requirements.txt
$ cd twitter-banner-switcher/bin
用法
$ twitter-banner-switcher -h Usage: twitter-banner-switcher [OPTIONS] Set Twitter profile banner to a random image from a specified folder or a list of paths Options: -c, --config-file FILENAME Path to YAML config file (default: ~/.twitter- banner-switcher.yml). -h, --help Show this message and exit.
示例
此处不太显示-您可以提供配置文件的路径:
$ twitter-banner-switcher -c twitter-banner-switcher.yaml
或者把它存到~/.twitter-banner-switcher.yaml然后运行 事情:
$ twitter-banner-switcher
示例配置文件
$ cat twitter-banner-switcher.yamlconsumer_key:"Twitterconsumerkey"consumer_secret:"Twitterconsumersecret"access_token:"Twitteraccesstoken"access_token_secret:"Twitteraccesstokensecret"banner_images:-"/home/bender/Photos/AwesomeTwitterBanners/"-"/home/bender/Downloaded/planet_express.png"
注意:banner_images可以是路径或路径列表(到目录 包含图像或直接到图像文件)。公认的格式是 gif、jpg、jpeg和png。