Commit Graph

393 Commits

Author SHA1 Message Date
Tim Abbott 802b3dc3b2 Add API endpoint to render some message content without sending a message.
(imported from commit e1604b3bf4fc65e958db22f280eba1b5d2ba1e90)
2013-08-01 14:01:58 -04:00
Tim Abbott 102b495609 api: Fix error reporting when result is not JSON.
Previously, we would return a JSONDecodeError to the user in the event
that the server returned a 500 error (or other non-JSON content).

(imported from commit 1624dfec6ac65d34216f4de91e33116a54e414fa)
2013-07-30 16:32:13 -04:00
Scott Feeney 409c495c78 Move API readme to README.md to match GitHub repo
(imported from commit ca30e948c158a4a285bcd002d45725ff13d47cc7)
2013-07-29 16:45:06 -04:00
Tim Abbott 975f4aa59f api: Fix path in send_message example.
(imported from commit 6aab581bf00736986ffcd11042c757eff0c78653)
2013-07-25 17:27:46 -04:00
Tim Abbott 0d077e7f41 [manual] Use api.zulip.com to access the Humbug API.
This needs to be deployed after the nginx configuration is deployed.

(imported from commit 167a3d9d27595d40883bb400ebcc44c4ad9b6a2f)
2013-07-25 17:27:46 -04:00
Tim Abbott 438739f6cc More miscellaneous humbughq.com=>zulip.com updates.
(imported from commit 9a3dbc4268f251c2c0b20d8b6a7e1dc672f1b385)
2013-07-25 17:27:45 -04:00
Tim Abbott bcf86cae98 Switch Humbug users in API examples to zulip.com email addresses.
(imported from commit 83abeafee8d7d146d950c3049568acbf51bb3a12)
2013-07-25 17:19:18 -04:00
Tim Abbott e2a74b0613 api: Fix using staging.humbughq.com as the base_url.
urlparse.urljoin(base_url, url) will drop any path inside base_url if
either the url has a leading "/" or base_url doesn't have a trailing
"/".  So adjust our API bindings to ensure that doesn't happen.

(imported from commit c080ee8c04b89127888609da28afc8b388af1911)
2013-06-28 15:57:28 -04:00
Tim Abbott ea8a80603a [manual] Change API URLs to be based on api.humbughq.com/api.
This must be deployed after we update our running nginx configuration
to serve api.humbughq.com.

(imported from commit b5c34ebdd595f55eecd6dca6a18a37f105107bd5)
2013-06-28 15:57:27 -04:00
Scott Feeney 83cd963c49 Remove unused imports
(imported from commit 9e3050c72a2d1137b9096c6cfa1c3945341b9a56)
2013-06-27 16:22:39 -04:00
Tim Abbott 84b073b05c API: Release several additional API calls to users.
(imported from commit 8b32fa126ab76dc80ee775482a9749dff17edf37)
2013-06-25 16:34:45 -04:00
Tim Abbott 1ec0ee0fd6 [manual] API add_subscriptions: Change arguments to support options.
Since in the future we might want requests to add subscriptions to
include things like colors, in_home_view, etc., we're changing the
data format for the add_subscriptions API call to pass each stream as
a dictionary, giving a convenient place to put any added options.

The manual step required here is updating the API version in AFS
available for use with the zephyr_mirror.py system.

(imported from commit 364960cca582a0658f0d334668822045c001b92c)
2013-06-25 16:34:45 -04:00
Tim Abbott 2a9498dfd3 API: Use humbug.init_from_options in send-message example.
(imported from commit d44cd5fafa565b2f4709714c2777ad9ce513d953)
2013-06-25 16:34:44 -04:00
Tim Abbott ce50812bca API get_members: Return a dictionary of users, not a list of tuples.
I believe this should require no special work on deploy, since some
grepping of logs suggests we are not currently using this API query.

(imported from commit 240086f900c6680cbc90bf6a2f334a9e1f172df6)
2013-06-25 16:34:43 -04:00
Tim Abbott 49a26b9c75 api: Don't require 'https://' in site option.
The --site= option is really only for internal developer use, so I
don't think we gain anything from being strict about it.

(And it doesn't help that the error message one gets pre-this-patch is
super confusing).  Fixes Trac #937.

(imported from commit 8d699982aa6830f9eae2bccd6d0c7a1e0e53dd56)
2013-06-18 14:59:07 -04:00
acrefoot b20eb5621f [api version bump] Update API documentation in the example scripts
Give better examples, and rewrite options parsing to be more consistent across examples.
Make it more obvious that you can use "--user" and "--api-key" with our python examples.

This bumps our python bindings to v0.1.9

(imported from commit 297468088f864b7d585e567dc45523ea681f1856)
2013-06-05 17:34:41 -04:00
Tim Abbott b753eb0c1e [manual] Include the events API in the API tarballs.
Previously our receive API bindings were broken in our API tarballs
because we weren't including the receive API bindings which they used.

This requires our deploying the built API tarball to the prod server
when we deploy it so that the link on /api isn't broken.

(imported from commit 14ecaab34556f4e29c72f4f567d8af73c89d6297)
2013-06-04 15:53:36 -04:00
Jessica McKellar 53de71c0b3 api: bump version to 0.1.7.
(imported from commit 71d1af3806dea82a55ff7f620a92ffb7f1b63a56)
2013-05-29 15:23:26 -04:00
Tim Abbott 880a74eea9 Fix too-long subjects sent by git and nagios integrations
(imported from commit 9bf3af613b07fb7c72125eee0d08fd4a16dfa88a)
2013-05-22 10:17:15 -04:00
Tim Abbott d467a93877 Add support for updating messages after they've been received.
Currently the interface for editing messages is limited to a
command-line API tool; it's great for testing with e.g.:

./api/examples/edit-message --message=348135 --content="test $(date +%s)" --site=http://localhost:9991 --subject="test"

The next commit will add a user interface for actually doing the editing.

(imported from commit bdd408cec2946f31c2292e44f724f96ed5938791)
2013-05-20 23:40:26 -04:00
Luke Faraone 4828c90c64 Implement Humbug SVN integration.
This post-commit hook depends on pysvn. After a transaction is completed,
a Humbug is sent to a configurable stream with the repo modified, actor,
and commit message.

(imported from commit 75cab82d5fe993ea7c4c05be07a7b61e770aff81)
2013-05-01 11:37:07 -07:00
Luke Faraone e3b72155b8 Bump API version
(imported from commit 2366dbabbb0395676bfe7ad908ce362c3aca84c2)
2013-04-18 09:57:54 -07:00
Luke Faraone 8e1268c8fa Update README so as not to lie about min requests version :)
(imported from commit 074adaa6d15014caad83b19f234dd291025fc667)
2013-04-18 09:57:53 -07:00
Zev Benjamin 130c94a2b1 Make the API bindings method for removing subscriptions have the same name we use in our example
(imported from commit de330caa997a02a9122f9d1d9fa0a3891f18f99f)
2013-04-01 13:05:57 -04:00
Zev Benjamin d12a6b8506 Remove the use of "--site" from the example scripts' usage text
Now that we're distributing these examples, we shouldn't be promoting
the use of the "--site" option.

(imported from commit 01ded4a851dc799fa6c7e902e937c4331ed92bf8)
2013-04-01 13:05:57 -04:00
Zev Benjamin a326eb2c48 Fix subscribe/unsubscribe example help text
(imported from commit 886066daa80b377b71b19f992d6733d87bc4d9d3)
2013-04-01 13:05:57 -04:00
Tim Abbott 9d82bb5318 event_queue: Add requests 1.x compatibility.
The previous version of our code only worked with python-requests <
1.0 (as is the case on our servers), the new version will work with
any python-requests new enough to have a .json at all.

(imported from commit 77ffe3e0d890fe88776c313e0e3289aee1bb30ea)
2013-03-29 16:18:37 -04:00
Zev Benjamin c4ed67b2d1 Raise the API polling timeout so it is greater than the heartbeat frequency
(imported from commit 3a6921a9b5c2c9cdf3ce279291de31d4657d9ae0)
2013-03-29 11:11:34 -04:00
Zev Benjamin 25e69b7e86 Add call_on_each_event() to our Python bindings
call_on_each_message() is now implemented in terms of
call_on_each_event().

(imported from commit b4f74ccf46e9cafd9a6ca28dce975492c2d0b29f)
2013-03-28 16:57:48 -04:00
Zev Benjamin cc16746219 Make python bindings use the event system
(imported from commit 5f47054bff4846018f8d606331de104a4ed2de0d)
2013-03-28 16:57:48 -04:00
Luke Faraone b1b88d22d7 Alternatively send request data using "params" if request method is GET
Previously we sent it always as "data", which caused problems for GET
requests where there is no request body.

(imported from commit 20084d1da1b8228cc484536ca4d6f77f547a9d78)
2013-03-28 12:53:42 -07:00
Luke Faraone e0cf6494ed Update API bindings to support new API URIs.
We also switch the Python client to use a client string of "API: Python"
to allow us to determine more easily which bindings our users are using.

(imported from commit 7216c3d150b371835f14d1bc8d81979a92e44925)
2013-03-28 07:59:31 -07:00
Luke Faraone a59d5b9ce6 Use 'Python API' as the API client string
(imported from commit 5c1f8a9c089aaed1c82729f81819b8373d796c2a)
2013-03-28 07:53:37 -07:00
Leo Franchi 6573a4ebb0 Bump API version to 0.1.5
(imported from commit 7c8c66369971e44405219eddac7e8bb3ddb44063)
2013-03-26 18:20:08 -04:00
Leo Franchi 360ded396e Include folders with subfolders when creating api tarball
(imported from commit b9d564a6cc4ee6e2afa0108b6d9f18af039fc8cf)
2013-03-26 18:20:02 -04:00
Leo Franchi dc2d8ece9f Add a groovy file for JIRA integration
(imported from commit 6336206e75389d3f52a868b54bfa79077337a24a)
2013-03-26 14:14:47 -04:00
Waseem Daher 4280affd1f Revert "Special CUSTOMER4 API release."
This reverts commit 47a8590a8b821cb1e2c8930f02a6bfbd42174af1.

(imported from commit fe336cce0bff798e9961ad2a66d942722ebbba86)
2013-03-15 00:27:42 -04:00
Waseem Daher 8ae102a99b Revert "Ship all of our examples in the API update tarball."
This reverts commit 4162114707f69bcfb6ecea95d7bdf4c080b4b168.

(imported from commit a4d68bc2a68209bed8e00e6d58dd5f5d3a3187f9)
2013-03-15 00:27:42 -04:00
Waseem Daher 7b801cbdfe Special CUSTOMER4 API release.
After this commit, we built an API tarball and sent it to
CUSTOMER4, and then promptly reverted the commit so that
we could continue as we had been before.

(imported from commit 662519a79edd508e7c115b451a7ec6fbdf1fc0a4)
2013-03-15 00:27:16 -04:00
Waseem Daher 226378304c Ship all of our examples in the API update tarball.
(imported from commit 4162114707f69bcfb6ecea95d7bdf4c080b4b168)
2013-03-15 00:22:49 -04:00
Jessica McKellar 4cfd486e67 twitter-bot: Fix hyphen typo in usage string.
(imported from commit a0da133bead740f60553a868c286e9eae461e861)
2013-03-08 15:58:45 -05:00
Jessica McKellar 0dd94f9913 demos: add a Twitter search bot.
(imported from commit 00c0c7b59616473ab2aec2a24b41798f7c8af322)
2013-03-08 15:58:45 -05:00
Jessica McKellar bd2807d3b7 Move twitter-bot to api/demos/.
(imported from commit eb0a9466b9064f89322ab593134af0761caeea8a)
2013-03-08 15:58:45 -05:00
Tim Abbott a64dd5a712 api: Fix version number check.
This fixes Trac #790.

(imported from commit 4bc82ac52298308bdb7d068ed6eee740e211aa56)
2013-03-06 14:19:32 -05:00
Tim Abbott 3be748ad25 [manual] Bump API version to 0.1.4.
To incorporate the site parsing fix from a couple weeks ago.

Before deploying this to prod we need to run build-api-tarball and
deploy the code to humbughq.com as for usual API releases.

(imported from commit f6711f5cc07d174c30866029032a595ecee785a3)
2013-03-05 10:17:57 -05:00
Jessica McKellar ad71168f77 Add an example RSS bot that runs out of cron.
(imported from commit 81d7e010f6316dfbe0ce7b645a7b61dde2881483)
2013-02-22 17:00:42 -05:00
Jessica McKellar 7202c50271 Install the demos directory in /usr/local/share/ as well.
(imported from commit 7516e5318f9e30544f53703ead4bca60f2dd7828)
2013-02-22 17:00:42 -05:00
Keegan McAllister 56d183ea06 Remove lurk mode from web client and API examples
See #796.

(imported from commit e238ce571c3f30d8312b630df7048ad1d9cad6d2)
2013-02-21 15:11:10 -05:00
Keegan McAllister 75704ad1e8 Consistently use #!/usr/bin/env python
At Ksplice we used /usr/bin/python because we shipped dependencies as Debian /
Red Hat packages, which would be installed against the system Python.  We were
also very careful to use only Python 2.3 features so that even old system
Python would still work.

None of that is true at Humbug.  We expect users to install dependencies
themselves, so it's more likely that the Python in $PATH is correct.  On OS X
in particular, it's common to have five broken Python installs and there's no
expectation that /usr/bin/python is the right one.

The files which aren't marked executable are not interesting to run as scripts,
so we just remove the line there.  (In general it's common to have libraries
that can also be executed, to run test cases or whatever, but that's not the
case here.)

(imported from commit 437d4aee2c6e66601ad3334eefd50749cce2eca6)
2013-02-20 16:02:30 -05:00
Keegan McAllister 8f5031687c post-receive: Send a notification to @everyone on non-fastforward
(imported from commit 8fc232dbef4b9b87f30f0b68c6407c43fd8553ba)
2013-02-19 17:39:55 -05:00