{ "info": { "author": "Douglas Paul Perkins", "author_email": "contact@dperkins.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Topic :: Communications" ], "description": "PumpTweet\n=========\n\nA Python script that cross posts from a Pump.io server to Twitter.\n\nOverview\n========\n\nIf you aren't familiar with `pump.io `__, take a look\nat https://microca.st/. Try it out and see what you think! This script\nis for people already using a pump.io service (like microca.st, but\nthere are many others, and you can run your own).\n\nThere are many different kinds of activities. Here, we look for *notes*,\nwhich are like regular blog entries. We find a note, shorten it, make a\nURL to the original, and tweet it. In other words, we're cross-posting\nfrom pump.io to Twitter.\n\nWhen you compose a note, you choose the recipients. This script will\ncross-post your note if it's ``To: Public`` or ``CC: Public``. Posts\nthat aren't sent to ``Public`` are ignored. Other pump activities\n(comments, likes, etc.) are excluded. It's not obvious how they would be\nof interest on Twitter.\n\nThis program is designed to be run as a cron job on a regular basis.\n\nExample\n=======\n\nPump notes can be of any length, but tweets are limited to 140\ncharacters. This program crops notes either (1) at the first line break\nor (2) as close as it can to 140 characters while still leaving room for\na link to the original note. Here are some examples.\n\nExample pump #1.\n\n::\n\n Have a great weekend, everyone!\n\nExample tweet #1. The URL is a link to the original note.\n\n::\n\n Have a great weekend, everyone! http://ur1.ca/fislx\n\nExample pump #2.\n\n::\n\n I have a technical question about cooling fans.\n\n My processor on my new machine is an i7. I'm using a SilverStone AR-01 heat sink. The heat sink is...\n\nExample tweet #2. Only the first line of the note is retained.\n\n::\n\n I have a technical question about cooling fans.\u2026 http://ur1.ca/fihk8\n\nContact\n=======\n\nIf you want to contact the author, here are some ways. Bug reports and\nimprovements are always welcome.\n\n- https://microca.st/dper\n- https://twitter.com/dpp0\n- https://dperkins.org/tag/contact.html\n\nPyPI Installation\n=================\n\nTo start with, you need Python. Python 3.4 and 3.5 have been tested and\nwork. Older versions probably don't.\n\nIt is easiest to install from\n`PyPI `__. First, make a\n``virtualenv``. The ``virtualenv`` is nice because it means software you\ninstall here won't interfere with anything else on the system. Also, if\nyou find something is wrong or you're otherwise unhappy, you can delete\nthe ``pumptweet`` directory.\n\n::\n\n $ cd\n $ mkdir pumptweet\n $ virtualenv pumptweet\n $ cd pumptweet\n $ source bin/activate\n (pumptweet)$ pip install pumptweet\n\nAssuming no errors showed up, you've installed ``pumptweet``. The next\nstep is to configure it.\n\nSource Installation\n===================\n\n- Browse: https://dperkins.org/git/gitlist/pumptweet.git.\n- Clone: https://dperkins.org/git/public/pumptweet.git.\n- GitHub: https://github.com/dper/pumptweet.git.\n\nIf you want to make custom modifications, consider a ``git`` install.\nThese instructions are for a Debian system. Other Linux and Unix\ndistributions should be similar. First, get the source code and put it\nin a ``virtualenv``.\n\n::\n\n $ cd\n $ git clone https://github.com/dper/pumptweet\n $ virtualenv pumptweet\n $ cd pumptweet\n $ source bin/activate\n\nThe command prompt should now begin with ``(pumptweet)``. You may also\nneed to install some dependencies, including\n`PyPump `__ and\n`python-twitter `__.\n\n::\n\n (pumptweet)$ pip3 install pypump\n (pumptweet)$ pip3 install python-twitter\n\nConfiguration\n=============\n\nIn order to use the script, create a file called ``PumpTweet.ini`` that\nlooks something like this.\n\n::\n\n [pump]\n username = \n\n [twitter]\n key = \n secret = \n token = \n token_secret = \n\n [history]\n recent = \n published = \n\nAll of the values in ``[pump]`` and ``[twitter]`` must be filled in, but\nthe two entries in ``[history]`` can be left blank. If you fail to fill\nin the top two sections, you'll get some kind of error when running the\nscript. For convenience, a file called ``PumpTweet.ini.blank`` is\nincluded. Copy that file or the above text to ``PumpTweet.ini`` and fill\nin the necessary sections.\n\nPlace the ``PumpTweet.ini`` filein the base installation directory. For\nexample, I installed pumptweet into ``~/pumptweet`` earlier in this\ndocument. My configuration file should be located at\n``~/pumptweet/PumpTweet.ini``.\n\nConfiguring Pump\n================\n\nThe script uses\n`PyPump `__\nto communicate with pump servers. This assumes you already have a pump\naccount.\n\nThe first thing you need to do is put your username (which looks like an\nemail address) into the ``[pump]`` section of the ini file. Next, run:\n\n::\n\n $ cd pumptweet\n $ source bin/activate\n (pumptweet)$ ./pt.py\n\nAt this point, you'll get a hyperlink to your pump server. Paste the\nlink into your browser to open a page where you can sign in and give the\napplication the necessary permissions. Paste the verifier back into the\nprompt to continue. This is all you need to do for ``[pump]``.\n\nConfiguring Twitter\n===================\n\nTo get the client validated with Twitter, use your favorite web browser.\nThis assumes you already have a Twitter account.\n\n- Go to https://apps.twitter.com/ and sign in.\n- Click ``Create new app``.\n- You need to give it a name (like ``pumptweet314``), a description\n (like ``A cross-posting script from Pump to Twitter.``), and a\n website (if you make a fork of pumptweet on GitHub, that would be a\n nice URL, but anything is OK). Also check the box agreeing with their\n terms and answer the CAPTCHA.\n- Click on the ``Settings`` tab. Change ``Access`` to\n ``Read and Write``. At the bottom of the screen, click\n ``Update this Twitter application's settings``.\n- Click on the ``Details`` tab. Near the bottom of the screen click\n ``Create my access token``.\n- Click on the ``Keys and Access Tokens`` tab. This screen should show\n you the four values needed in the ini file. Copy and paste them.\n That's all you need to do for ``[twitter]``.\n\nRunning the script\n==================\n\nTo run the script, just call it. If you're missing any dependencies\n(like the ones documented above), you'll find out about it here. If you\ninstalled pumptweet from source, run it as follows.\n\n::\n\n (pumptweet)$ ./pt.py\n\nIf you installed it using ``pip``, run it as follows.\n\n::\n\n (pumptweet)$ ./bin/pt.py\n\nIf everything is working, you should see something like the following.\nIn this example, there's one new note and therefore one new tweet which\nis posted to Twitter.\n\n::\n\n Reading the config file...\n Logging into the pump.io server...\n Logging into Twitter...\n Converting posts to tweets...\n Looking at pump.io outbox activity...\n > note (2013-09-12 11:31:49+00:00)\n > note (2013-09-12 10:40:24+00:00)\n Printing tweets...\n > Microca.st: Someone put on a pot of coffee at 3PM today. I can't have coffee in the afternoon and reliably get to ... http://ur1.ca/fhy3z\n Posting to Twitter...\n Updating history...\n\nIf you run the script a second time, it looks to see if there is\nanything new since last time it ran. In the below example, it looks at\none post and stops, because that post isn't any newer than what the\nscript handled last time around. Nothing is posted to Twitter.\n\n::\n\n Reading the config file...\n Logging into the pump.io server...\n Logging into Twitter...\n Converting posts to tweets...\n Looking at pump.io outbox activity...\n > note (2013-09-12 11:31:49+00:00)\n Printing tweets...\n Posting to Twitter...\n Updating history...\n\nFor convenience, there is a bash script, ``pt.sh`` that does\n``virtualenv`` stuff for you. Call that script from the command line to\nmake sure it works. If you installed from source, run it as follows.\n\n::\n\n $ cd /home/me/pumptweet && pt.sh\n\nIf you installed using ``pip``, run it as follows.\n\n::\n\n $ cd /home/me/pumptweet && ./bin/pt.sh\n\nCron and rate limits\n====================\n\nSuppose you have installed the program in ``/home/me/pumptweet`` and\nhave tested it using ``pt.sh`` to confirm that all is in working order.\nThe next thing to do is to make a cron job (using ``crontab -e``) like\nthe following. The following cron job runs every five minutes.\n\n::\n\n */5 * * * * cd /home/me/pumptweet && ./pt.sh > /dev/null\n\nFor most users, there is no worry, but if you tend to write many notes\nin a short amount of time, cross posting can be somewhat delicate.\nTwitter has a rate limit, though I don't know exactly what it is. This\nscript posts up to three tweets at a time. If you have written five\nnotes since the last time you called it, the newest three will become\ntweets and the oldest two will be forgotten.\n\nIf you find that you write many notes and they're being skipped, you can\nchange ``PumpTweet.py`` and post more than three at a time. But don't\nraise the value too high, or you might hit the Twitter rate limit, start\nlooking spammy to your Twitter followers, or both. A better approach\nmight be a more frequent cron job.\n\nErrors\n======\n\nIdentifying errors can be difficult. If the Pump or Twitter servers are\ncompletely offline, you will get an obvious error message, but if\nthey're partly offline, you might not. Similarly, if your login is\nincorrect, you might see confusing error messages. If you're not sure\nwhat's going wrong, you are encouraged to open an issue, contact the\ndevelopers, or post a message to the Pump network.\n\nTesting\n=======\n\nIf you're trying to modify the script or track down some other error,\nyou might want to do test runs. In that case, call the script as\nfollows, updating the directories according to where you installed it.\n\n::\n\n (pumptweet) $ pt.py --test\n\nFor the (very short) command line help documentation, use this command.\n\n::\n\n (pumptweet) $ pt.py --help\n\nGNU social\n==========\n\n`GNU social `__ has a Twitter-like API, and you\ncan use this script, with a few modifications, to cross-post from\nPump.io to GNU social.\n[@sazius](https://pump.saz.im/sazius/note/jdTJx2pQRGiEDpB5eDlXEg) has\ndone so, and here is what he says.\n\n It was quite easy: just add the parameter\n ``base_url='https://your.gnu.social/api'`` to the call to\n ``twitter.API()`` in ``twitter_login`` in ``PumpLogin.py``. I guess\n you could have that as a configurable parameter.\n\n Next problem was to get the OAuth token from GNU Social, I used the\n ``get_access_token.py`` script, but you have to add\n ``?oauth_callback=oob`` to the ``REQUEST_TOKEN_URL``, and of course\n replace the Twitter API URLs with the one for GNU social.\n\nThanks\n======\n\nThe ``pump.io`` community at large has helped advertise this project.\nThanks to everyone there for support. See ``AUTHORS.md`` for a list of\nthose wonderful individuals who contributed code.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/dper/pumptweet", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pumptweet", "package_url": "https://pypi.org/project/pumptweet/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pumptweet/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/dper/pumptweet" }, "release_url": "https://pypi.org/project/pumptweet/2.1/", "requires_dist": null, "requires_python": null, "summary": "Cross posts from Pump.io to Twitter.", "version": "2.1" }, "last_serial": 2253406, "releases": { "1.4": [ { "comment_text": "", "digests": { "md5": "6ac0710e196d8f4ad782e8c629b6c66a", "sha256": "aeae65af1a564cdbb8debdbe8fa11859bd5008abd0f2ef21a9d5777259aa6013" }, "downloads": -1, "filename": "pumptweet-1.4.tar.gz", "has_sig": false, "md5_digest": "6ac0710e196d8f4ad782e8c629b6c66a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4701, "upload_time": "2014-12-23T02:57:28", "url": "https://files.pythonhosted.org/packages/f3/e7/a8b7238bb05f85946d26ca873f2d50c7e663fadcd5f457c91a3ae2493560/pumptweet-1.4.tar.gz" } ], "1.4.8": [ { "comment_text": "", "digests": { "md5": "ba7a4a965c823f8e71a44061f65c874f", "sha256": "300f968d280c74e47c6fc9eac0765ad46e4c65b03afd04ada4061d4489fca106" }, "downloads": -1, "filename": "pumptweet-1.4.8.tar.gz", "has_sig": false, "md5_digest": "ba7a4a965c823f8e71a44061f65c874f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81928, "upload_time": "2014-12-23T07:53:22", "url": "https://files.pythonhosted.org/packages/9d/ee/668278a6064c68a8ac3bc846ce4e30c0d10d218cce67f67b0dcde09a49da/pumptweet-1.4.8.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "335ef367204c9a04102d2b72ad2944b1", "sha256": "33a1f588195aeb79f8446d98aef0d0188c16b9673e7790fa26b0734359aa974c" }, "downloads": -1, "filename": "pumptweet-1.5.0.tar.gz", "has_sig": false, "md5_digest": "335ef367204c9a04102d2b72ad2944b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81877, "upload_time": "2014-12-23T08:42:50", "url": "https://files.pythonhosted.org/packages/af/f8/621e1c730bb809c2306cbb8d011e03c4c7bfe955680d1345c0d7c5b6bcb2/pumptweet-1.5.0.tar.gz" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "01e46f1af414df67189c9b97b4ff8e8e", "sha256": "20472a64206b81a97e7a6b96e3c299faa8431dde388c076b34cbcd76e6acf42b" }, "downloads": -1, "filename": "pumptweet-1.6.1-py2-none-any.whl", "has_sig": false, "md5_digest": "01e46f1af414df67189c9b97b4ff8e8e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17034, "upload_time": "2015-09-01T10:43:47", "url": "https://files.pythonhosted.org/packages/f0/63/725bba80d8d08f0b6befe0a7b47267c5d260934670d3817ce60f425755ad/pumptweet-1.6.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7e5b9ef9e189d7dd68958f66a057957", "sha256": "ffe48cd514b13303ba84f2c43453b0a3a12bb24e241616122ccc31682c3cda2c" }, "downloads": -1, "filename": "pumptweet-1.6.1.tar.gz", "has_sig": false, "md5_digest": "d7e5b9ef9e189d7dd68958f66a057957", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81947, "upload_time": "2015-09-01T10:43:52", "url": "https://files.pythonhosted.org/packages/2b/64/c7ac8528986a3fac71c802a10f16cd5354a50ba543680485ddce59837525/pumptweet-1.6.1.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "849c9f9dfc0dc0393224384754d33f85", "sha256": "0ba072fd4664e0376d1a91a4eba0f671d412994d5b3d50cba0df0ea2cec2e6b9" }, "downloads": -1, "filename": "pumptweet-2.1.tar.gz", "has_sig": false, "md5_digest": "849c9f9dfc0dc0393224384754d33f85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 86146, "upload_time": "2016-07-31T06:49:53", "url": "https://files.pythonhosted.org/packages/44/2b/dae1b5980eb43f5822a5f03b11c99457c90dfb19978212ad99590057e55e/pumptweet-2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "849c9f9dfc0dc0393224384754d33f85", "sha256": "0ba072fd4664e0376d1a91a4eba0f671d412994d5b3d50cba0df0ea2cec2e6b9" }, "downloads": -1, "filename": "pumptweet-2.1.tar.gz", "has_sig": false, "md5_digest": "849c9f9dfc0dc0393224384754d33f85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 86146, "upload_time": "2016-07-31T06:49:53", "url": "https://files.pythonhosted.org/packages/44/2b/dae1b5980eb43f5822a5f03b11c99457c90dfb19978212ad99590057e55e/pumptweet-2.1.tar.gz" } ] }