Inthing Posts

4 posts tagged with inthing

Inthing can take a screenshot of your desktop then post it online.

Here's a quick example:

Alternatively you can do the same thing from the command line with the inthing app. The following is equivalent to the Python code (assuming you have set up the stream and password environment variables):

See the docs for more details.

Screenshot capabilities courtesy of the excellent pyscreenshot library.

Screenshot taken with Stream.screenshot

Just landed in inthing is a new and quite interesting feature.

Version 0.1.4 adds a capture method which will record all standard output, i.e. anything you print to the terminal. It works as a context manager. Here's an example:

Any print statement inside the with block will be captured and posted online with the block exits.

You can also do something similar from the command line, with the inthing capture subcommand, which posts anything you pipe in to it as an event.

lets say you wanted to post the version of all you installed Python packages online. You could do something like the following:

For more information see the Inthing docs.

Inthing is still technically in beta, but these features are quite solid. Please give them a try, and let me know how it goes!

One of my goals for was to make posting events realtime, in that events appear without a page refresh, and within a fraction of a second. And that largely seems to work.

Here's a quick screencast that shows it working:

I'll post about how it works in detail at some point, but the general gist is that there is a Tornado websocket server that inthing uses to broadcast information about updates. That server may be worth open-sourcing if there is enough interest. It could be useful for other projects, and its entirely independent.

There a few options, but I'm going to suggest using the inthing Python module.

First install inthing with PIP. You'll probably know if you need to use sudo or not:

Now fire up Python, and enter the following (copy and paste each line after the >>> prompt):

So far so good. We now have a Stream object called stream, with a corresponding live page on the web. We'll have a look at that later, but lets first do something interesting with it. Enter the following function (copy and paste all the text after the >>>):

If that pasted correctly, we should have a function that generates the Mandlebrot set in ASCII. Add it to the stream with the following:

Finally, to get the URL of the stream, do this:

If you visit that URL, you should see the Mandlebrot set you just generated. continue reading…