lord63 / wonderful_bing Goto Github PK
View Code? Open in Web Editor NEWSet bing's picture as wallpaper, support cinnamon, gnome, xfce, mate.
License: MIT License
Set bing's picture as wallpaper, support cinnamon, gnome, xfce, mate.
License: MIT License
I use Linux Mint 16(cinnamon) most of my time, sometimes Windows in my virtualbox.
Currently, wonderful_bing only supports Linux(Gnome and xfce4).
I'd appreciate it that if you think wonderful_bing is good and you'd like to make it more widely used.
If you use Chinese, the picture info should be Chinese;
If you use English, the picture info should be English.
It seems that Bing changed it again....
(:з」∠)
😄
Traceback (most recent call last): File "/usr/local/bin/bing", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/wonderful_bing/wonderful_bing.py", line 159, in main wonderful_bing = WonderfulBing(arguments) File "/usr/local/lib/python2.7/dist-packages/wonderful_bing/wonderful_bing.py", line 126, in __init__ self.picture_path = path.join(self.directory, self.bing.picture_name) File "/usr/lib/python2.7/posixpath.py", line 73, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)
貌似Bing改版了,之前可以得到的今日图片故事的内容暂时无法直接从html中找到。
Maybe...
From wonderful_bing to bing? The original one was too long, but I always make it run automatically so I don't feel much annoying.
Add the script to crontab, it will download the picture, but the wallpaper still as the same.
_(":3JZ.
v0.4.3 released. because the test used the old way in v0.4.2, so the travis ci failed. You can also hava a look at #7. So, we need write a better test case or just drop it.
In v0.5.1, I add support for xfce4, so I need to detect the desktop environment, you can use it gracefully in the terminal, but fail in cron or if you add it to startup. It seems that the program can't get the right desktop environment.
e.g. run this test.py in cron
# test.py
import os
print os.environ.get("DESKTOP_SESSION")
I get None
instead of the right answer cinnamon
self.url = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&nc=1409879295618&pid=hp"
information = requests.get(self.url).json()["images"][0]
self.picture_url = information["url"]
if I use proxy, the json file would be like this:
{"images":[{"startdate":"20140925","fullstartdate":"201409250700","enddate":"20140926","url":"/az/hprichbg/rb/LakeButtermere_ROW10783939870_1366x768.jpg",...}
If I don't use proxy, the json file would be like this:
{"images":[{"startdate":"20140924","fullstartdate":"201409241600","enddate":"20140925","url":"http://s.cn.bing.net/az/hprichbg/rb/TsinghuaArche_ZH-CN7826742772_1366x768.jpg",...}
And you should notice that the url in the first json file is not the full url.
You can find the details about why the build failed here
requests.exceptions.MissingSchema: Invalid URL u'/az/hprichbg/rb/LakeButtermere_EN-US10467595735_1366x768.jpg': No schema supplied. Perhaps you meant http:///az/hprichbg/rb/LakeButtermere_EN-US10467595735_1366x768.jpg?
I tested it at local and it was fine(because I didn't use proxy), when I pushed the code to github, the test failed, I think that's the reason why the test failed.
Since I use notify-send
to show the notify, and there may be some special characters in the content
, for example, (
, )
, '
, we need to do something.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.