Note that there are some explanatory texts on larger screens.

plurals
  1. POa little bit of python help
    text
    copied!<p>i need a little help here, since i am new to python, i am trying to do a nice app that can tell me if my website is down or not, then send it to twitter.</p> <pre><code>class Tweet(webapp.RequestHandler): def get(self): import oauth client = oauth.TwitterClient(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, None ) webstatus = {"status": "this is where the site status need's to be", "lat": 44.42765100, "long":26.103172 } client.make_request('http://twitter.com/statuses/update.json', token=TWITTER_ACCESS_TOKEN, secret=TWITTER_ACCESS_TOKEN_SECRET, additional_params=webstatus, protected=True, method='POST' ) self.response.out.write(webstatus) def main(): application = webapp.WSGIApplication([('/', Tweet)]) util.run_wsgi_app(application) if __name__ == '__main__': main() </code></pre> <p>now the check website part is missing, so i am extremely new to python and i need a little bit of help </p> <p>any idea of a function/class that can check a specific url and the answer/error code can be send to twitter using the upper script</p> <p>and i need a little bit of help at implementing url check in the script above, this is my first time interacting with python. </p> <p>if you are wondering, upper class uses <a href="https://github.com/mikeknapp/AppEngine-OAuth-Library" rel="nofollow">https://github.com/mikeknapp/AppEngine-OAuth-Library</a> lib</p> <p>cheers</p> <p>PS: the url check functionality need's to be based on <code>urlfetch</code> class, more safe for google appengine</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload