Commit graph

57 commits

Author SHA1 Message Date
Tim Abbott 35a2435195 api: Fix path in send_message example.
(imported from commit 6aab581bf00736986ffcd11042c757eff0c78653)
2013-07-25 17:27:46 -04:00
Tim Abbott 22e5a15bc4 [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 deaa19605a 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 5e2979b870 [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
Tim Abbott 58f4ffe088 [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 1373c5535e API: Use humbug.init_from_options in send-message example.
(imported from commit d44cd5fafa565b2f4709714c2777ad9ce513d953)
2013-06-25 16:34:44 -04:00
Tim Abbott 05596740ad 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
acrefoot dfb8a16a55 [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 be7903443c 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
Zev Benjamin 56f3a33c01 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 07e5390659 Fix subscribe/unsubscribe example help text
(imported from commit 886066daa80b377b71b19f992d6733d87bc4d9d3)
2013-04-01 13:05:57 -04:00
Keegan McAllister ec86a6a749 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 396861feb1 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
Jessica McKellar d925f20428 api: Add a list-members example script for the /get_members query.
(imported from commit 2fc213b746eb032b98d86f933ce69e7cbe9822d1)
2013-02-11 13:45:47 -05:00
Waseem Daher 2aad7624d1 api: Move integrations into their own subdirectory.
(imported from commit e1a64fbbc64e64e7a2c2fdda4cc9bc77ff3bc852)
2013-02-07 14:15:44 -05:00
Waseem Daher 0b22339623 Simplify the Trac integration plugin options slightly.
(imported from commit 4588d70f4e7664a9ba85be7003e17d4e8f55a333)
2013-02-06 17:37:44 -05:00
Zev Benjamin 5acf8f93b5 Add a copy of our Trac integration (with example constants) to the API examples
(imported from commit 4e7bfaf92842ae0bb24c28ae1187d83ca5c44b0e)
2013-02-06 11:45:43 -05:00
Luke Faraone e2c9146690 Be more explicit as to where .humbugrc goes
(imported from commit 3e229d61ebfef64e29ca45cc57eca04ec207ae86)
2013-02-05 16:35:45 -05:00
Luke Faraone d8f13837d9 Move files around in the API.
Bots are not part of what we distribute, so put them in the repo root.

We also updated some of the bots to use relative path names.

(imported from commit 0471d863450712fd0cdb651f39f32e9041df52ba)
2013-02-01 15:52:28 -05:00
Luke Faraone f2f4a2f8bd Move the API into a subdirectory for ease of imports.
Previously, if users of our code put the API folder in their pyshared
they would have to import it as "humbug.humbug". By moving Humbug's API
into a directory named "humbug" and moving the API into __init__, you
can just "import humbug".

(imported from commit 1d2654ae57f8ecbbfe76559de267ec4889708ee8)
2013-01-16 16:55:22 -05:00
Reid Barton 96cd0fc325 Add --stream option to print-messages, print-next-message API examples
(imported from commit aeaf8a111759de59ba87fc7014be86bd13810271)
2013-01-16 14:19:05 -05:00
Luke Faraone b3e67d2ac4 Document humbug-send and humbugrc in README for API users
(imported from commit 9ca282d4d768f2d2a474da1209621f03147954fe)
2012-12-12 16:48:00 -05:00
Luke Faraone f1d60f5417 Switch to the option group pattern for API examples.
(imported from commit 67d0164df822a56f06d5f959297cc2efa9706001)
2012-12-12 16:48:00 -05:00
Luke Faraone b6f96f27ba Update copyright notices for consistency, use the copyright symbol.
No textual changes were made besides reflowing text and subbing © for
(C).

(imported from commit e36108ad31be6ec65325e4ac48e9fb7d17e409ff)
2012-12-12 16:48:00 -05:00
Keegan McAllister b9325a09fa Rename class HumbugAPI to Client
(imported from commit 4270f31fc5febcd9c444d0d133a1dad3860618f0)
2012-12-03 15:54:54 -05:00
Keegan McAllister f9f8a6e603 Rename api.common to humbug
Fixes #482.

(imported from commit 1bd6a7fd993d8d5e225e0311c288dbce0c369a40)
2012-12-03 15:54:54 -05:00
Tim Abbott faa2470ed5 send_message: Accept subject and message arguments.
(imported from commit 93aca5e750fa74d7ee95d8a00adbf6d4e61b2fc8)
2012-11-27 14:02:24 -05:00
Tim Abbott ebf009b232 api: Extend documentation a bit.
(imported from commit fd435286e12ffebad8476cc8005303b2d8d70fd9)
2012-11-27 12:09:56 -05:00
Keegan McAllister 185ab66797 examples/send-message: Remove default sender
(imported from commit 30ada075ac4f1b759fe787eef6a93275dbea584c)
2012-11-26 14:57:20 -05:00
Keegan McAllister b65ce435c4 api/examples: Simplify optparse use
- The default 'default' is None
- The default 'dest' is the option name, with - replaced with _
- The default 'action' is 'store'

Not coincidentally, these defaults are correct for most of our existing code.

(imported from commit 9c6078bd778324e08e1ca214a97281a7bdce08c2)
2012-11-26 14:57:20 -05:00
Keegan McAllister 4a62308ab9 api/examples: Rework sys.path computation
(imported from commit 6e4c2a9b5f5ab6f6680704a1e06bd17fd95bd038)
2012-11-26 14:57:20 -05:00
Tim Abbott 4903843151 api: Add an extra send_message example.
(imported from commit fe5ab550fa862f587cdf7987c5b238dffab45672)
2012-11-26 12:25:39 -05:00
Tim Abbott 03dc2b2af1 api: Don't use 127.0.0.1:8000 as an example.
At least the zephyr.humbughq.com case is one our users might find
useful.  I imagine we'll end up hiding --site once we integrate the
zephyr and main site tornado servers.

(imported from commit a3a28492cf3f32b78eab6bbd48ba66be2f38a5f2)
2012-11-26 12:25:39 -05:00
Tim Abbott 9d6ce4ee0b api: Add copyright and MIT license notices to distributed tools.
(imported from commit 9f93050f988549dc363f5a7c798c8a9fa1c01d29)
2012-11-26 12:25:38 -05:00
Tim Abbott c5a140303c api: Remove hardcoded API keys from examples.
(imported from commit 64bf22298452a436d0aec796973a77f10d5e0bf9)
2012-11-26 12:25:38 -05:00
Tim Abbott 5689e99a0d API: Add unsubscribe function.
(imported from commit 6dc55e9030770500770ce3921a4e77499d64f2d6)
2012-11-16 17:06:01 -05:00
Tim Abbott 584743eca8 [manual] Uniformize the subscriptions API method names.
This requires a zephyr_mirror deployment when it is pushed to prod.

(imported from commit 6543441fb264b518f8705d7989d068a1d50ce5d6)
2012-11-16 17:06:01 -05:00
Tim Abbott 3ed6273a16 send-message: Add sending to streams and some code cleanup.
(imported from commit 806b17bd959f643a7422f9fcf5d24d6f945a18c2)
2012-11-15 15:31:48 -05:00
Tim Abbott 6727e9dbd9 [manual] send_message: Rename recipient/stream fields to 'to'.
This commit changes APIs and requires and update of all zephyr
mirroring bots to deploy properly.

(imported from commit 2672d2d07269379f7a865644aaeb6796d54183e1)
2012-11-15 15:30:06 -05:00
Zev Benjamin 83a446d1ea Make send-message API example program more flexible
(imported from commit e1fa90169500f84b088f1697c31641c24ed93bc8)
2012-11-14 17:35:38 -05:00
Zev Benjamin 73daa73887 Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient).  The
new message type on the send path is 'private'.  Note that the receive
path still has 'personal' and 'huddle' message types.

(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Keegan McAllister b88df2cf8e Change default site in API clients
(imported from commit 185cf8e27cb6ecd1cd8ccca834d30ca0de2236b8)
2012-10-27 11:38:15 -04:00
Keegan McAllister 982623e90d Wrap some other extremely long lines
(imported from commit e7d55f318c8865ca953bf4520d1b07f7e84a4aeb)
2012-10-25 15:22:18 -04:00
Tim Abbott 06a6cf20b5 Add print-next-message API example.
(imported from commit 73880275d2665e75d11def7447051c2b0c3b798b)
2012-10-19 11:37:51 -04:00
Tim Abbott 4fb6a4ab7c Fix typo in API tool usage.
(imported from commit 235eca10897b8f62bf2a7d8a7299b8b1f6906ec6)
2012-10-19 11:36:00 -04:00
Tim Abbott ffd2f14df5 Fix issues with trailing slashes in API examples URLs.
(imported from commit f557a65e36aefcdcd9e072e9144f3ec69f518192)
2012-10-18 11:32:58 -04:00
Keegan McAllister 30d1dda8ed api: Drop HTTP Digest authentication
(imported from commit 6867528cbd51a9e4a7cdacb181befcd034b90d59)
2012-10-17 18:24:15 -04:00
Keegan McAllister c2ddbeb8f4 curl-examples: Check cert
(imported from commit 5496142cbb1ef737ea7fc0063722a578fb7df437)
2012-10-17 18:24:15 -04:00
Tim Abbott 5443bdc50c Mark more API examples as executable.
(imported from commit 1d21e05af00e9ae37ef38d6e6d56c88e0d764f82)
2012-10-12 10:40:12 -04:00
Tim Abbott eb8a9f5ad5 Fix descriptions of some API examples.
(imported from commit 105211905b27d03906506af41522854cbb53479a)
2012-10-11 16:20:45 -04:00