This wishful brainstorming inspired me to start building exactly that.
But first, a digression.

The idea reminded me of an idea I got from Adam
Smith back when I was working on
Scriptlets. If you can execute code from a URL, you could "store" a
program in a shortened URL. I decided to combine this with the
curl-pipe-bash technique that's been starting to get popular to
bootstrap installs. If you're unfamiliar, take this Gist of a Bash
script:

Given the "view raw" URL for that Gist, you can curl it and pipe it into Bash to
execute it right there in your shell. It would look like this:

Instead of having Gist store the program, how could we make it so the
source would just live within the URL? Well in the case of
curl-pipe-bash, we just need that source to be returned in the body of a
URL. So I built a simple app to run on Heroku that takes the query
string and outputs it in the body, a sort of echo service.

Letting you do this:

$ curl "http://queryecho.herokuapp.com?Hello+world"
Hello world

Which you could conceal and shorten with a URL shortener, like Bitly. I
prefer the j.mp domain Bitly has. And since they're just redirecting you to the
long URL, you'd use the -L option in curl to make it follow redirects:

$ curl -L http://j.mp/RyUN03
Hello world

When you make a short URL from the bitly website, they conveniently make
sure the query string is properly URL encoded. So if I just typed
queryecho.herokuapp.com/?echo "Hello world" into bitly, it
would give me a short URL with a properly URL encoded version of that
URL that would return echo "Hello world". This URL we could then curl-pipe into Bash:

$ curl -Ls http://j.mp/VGgI3o | bash
Hello world

See what's going on there? We wrote a simple Hello world program in Bash
that effectively lives in that short URL. And we can run it with
the curl-pipe-bash technique.

Later in our conversation, Joel suggests an example "app tweet" that if
executed in Bash given a URL argument, it would tell you where it
redirects. So if you gave it a short URL, it would tell you the long
URL.

Luckily I didn't have to do all that URL encoding. I just pasted his
code in after queryecho.herokuapp.com/? and bitly took care of it.
What's funny is that this example program is made to run on short URLs,
so when I told him about it, my example ran on the short URL that
contained the program itself:

You may have noticed my version of the program uses $url instead of
$1 because we have to use environment variables to provide input to
curl-pipe-bash scripts. For reference, to run my URL script against the
google.com short URL we made before, it would look like this:

Okay, so we can now put Bash scripts in short URLs. What happened to
installing apps in Tweets? Building an apptweet program like Joel
imagined would actually be pretty straightforward. But I wanted to build
it in and install it with these weird programs-in-short-URLs.

The first obstacle was figuring out how to get it to modify your current
environment. Normally curl-pipe-bash URLs install a downloaded program
into your PATH. But I didn't want to install a bunch of files on your
computer. Instead I just wanted to install a temporary Bash function
that would disappear when you leave your shell session. In order to do
this, I had to do a variant of the curl-pipe-bash technique using eval:

As you can see by inspecting that URL, it just defines a Bash function
that runs a Python script from a Gist. I cheated and used Gist for some
reason. That Python script uses the Twitter embed endpoint (same one
used for the embedded Tweets in this post) to get the contents of a
Tweet without authentication.

The next thing I built installed and used fetchtweet
to get a Tweet, parse it, put it in a Bash function named by the string
after an #exectweet hashtag (which happens to also start a comment in Bash). So here we have a Tweet with a program in it: