This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
from flask import * | |
import random | |
from apscheduler.schedulers.background import BackgroundScheduler | |
app = Flask(__name__) | |
scheduler = BackgroundScheduler() | |
url = "https://reddit.com/r/gonewild/comments.json?limit=200" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# requires pychromecast and probably python 2.7, sorry | |
import pychromecast | |
import argparse | |
def play_video(url, cast): | |
if cast.media_controller.status.player_state == "PAUSED" or cast.media_controller.status.content_id == url: | |
cast.media_controller.play() | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example usage: | |
>>> netflix("60024942") | |
(u'Catch Me If You Can', u'2002', u'Thu Jan 09 08:00:00 UTC 2003', u'M', u'140 minutes', u'http://cdn2.nflximg.net/images/0432/12050432.jpg', u'An FBI agent makes it his mission to put cunning con man Frank Abagnale Jr. behind bars. But Frank not only eludes capture, he revels in the pursuit.', {u'director': u'Steven Spielberg', u'genre': u'Dramas', u'language': u'English', u'starring': u'Leonardo DiCaprio, Tom Hanks'}) | |
ID could be obtained through trivial URL parsing using any stdlib library. | |
Here, i'll do an example: | |
from urlparse import urlparse, parse_qs # urllib.parse in python 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.goebl.david; | |
import junit.framework.TestCase; | |
import org.json.JSONObject; | |
public class TestWebb_LocalStackoverflow23678518 extends TestCase { | |
public void testPost() throws Exception { | |
JSONObject register = new JSONObject(); |