random-wall
A jQuery plugin that randomly changes background-image of an element.
What is random-wall?
Parse a wallpaper webpage (http://www.reddit.com/r/wallpapers/) and get a url of randomly selected image. You can set delay_time
to change a background-image without a new page load. If not, random-wall
will only change a background-image only when a page is reloaded.
See a live demo here;
delay_time
to change a background-image without a new page load. If not, random-wall
will only change a background-image only when a page is reloaded.Installation
To use, download the minified library into your javascripts directory. jquery.random-wall.js is also available unminimized.
Usage
Include jQuery and random-wall into your HTML.
<script src="jquery.min.js"></script>
<script src="jquery.random-wall.min.js"></script>
You should have a div field to change a background-image.
<div id="random-wall" /> </div>
Now, attach the plugin to the text field.
<script>
$("#random-wall").randomwall({
delay_time: 0, // default: 0 miliseconds (optional)
});
</script>
or you can set your own image links.
<script>
$("#random-wall").randomwall({
image_list: ['http://i.imgur.com/CiAvVQL.jpg',
'http://i.imgur.com/qC5Nprs.jpg',
'http://i.imgur.com/fckzvp1.jpg',
'http://i.imgur.com/od4QZ8C.jpg'] // use only these images (optional)
});
</script>
<script src="jquery.min.js"></script>
<script src="jquery.random-wall.min.js"></script>
<div id="random-wall" /> </div>
<script>
$("#random-wall").randomwall({
delay_time: 0, // default: 0 miliseconds (optional)
});
</script>
<script>
$("#random-wall").randomwall({
image_list: ['http://i.imgur.com/CiAvVQL.jpg',
'http://i.imgur.com/qC5Nprs.jpg',
'http://i.imgur.com/fckzvp1.jpg',
'http://i.imgur.com/od4QZ8C.jpg'] // use only these images (optional)
});
</script>
저 github 에 있는 헥사봇 말인데요 파이썬으로 실행해도 실행이 안되요..
답글삭제혹시 파이썬 버젼이 달라서 안되는건가요?
봇을 만드시는분들께 코드 자체만 참고하시라고 올려두었습니다.
삭제실행은 당연히 안됩니다 :)