Gráfico de commits

374 commits

Autor SHA1 Mensaje Fecha
Lorenz Diener
838b851331 Fix get_supported_version() 2018-01-29 13:39:47 +01:00
Lorenz Diener
216a4447b4 Fixed event not being cleared after dispatch 2018-01-29 12:28:44 +01:00
Lorenz Diener
791439d96b Remove state from handle_stream, fixes #119 2018-01-29 12:24:53 +01:00
codl
e97dec7306
subclass api errors 2018-01-03 11:34:45 +01:00
Lorenz Diener
18543648a6 Adjust streaming tests 2017-12-21 11:06:13 +01:00
Lorenz Diener
08a0e5ff67 Daemonize streams 2017-12-19 15:06:44 +01:00
Lorenz Diener
9f9a7826d7 Fix streaming API to be more stable (closes #117) 2017-12-19 13:49:00 +01:00
Lorenz Diener
e5c50ea80d Fix missing async in hashtag/list streams 2017-12-19 11:04:53 +01:00
Lorenz Diener
f55ff45393 Prepare release, part 2 2017-12-15 20:26:25 +01:00
Lorenz Diener
e97bb44c86 Update changelog (preliminary) 2017-12-14 15:09:54 +01:00
Lorenz Diener
301d719b83 Fix some problems with attribute access 2017-12-14 13:54:31 +01:00
Lorenz Diener
20c1d95b45 Fix version check 2017-12-14 13:32:52 +01:00
Lorenz Diener
5a94c46bb4 Change default version check behaviour 2017-12-14 13:29:42 +01:00
Lorenz Diener
af81088fb0 Make attribute-style access better 2017-12-14 13:16:28 +01:00
Lorenz Diener
12f8a68996 Add dict attribute access 2017-12-14 12:52:33 +01:00
Lorenz Diener
16564c42b8 Fix account_statuses breakage 2017-12-14 11:17:18 +01:00
Lorenz Diener
58dfdfaec5 Add supported version in a place where python can read it 2017-12-14 00:37:19 +01:00
Lorenz Diener
94fb509bac Merge branch 'master' of https://github.com/halcy/Mastodon.py 2017-12-14 00:27:45 +01:00
Lorenz Diener
e9d7a3e24a Add last-changed versioning 2017-12-14 00:27:34 +01:00
Lorenz Diener
b03b35a32a
Delete .Mastodon.py.kate-swp 2017-12-13 22:51:02 +01:00
Lorenz Diener
afaab2b874 Document list endpoints 2017-12-13 22:33:29 +01:00
Lorenz Diener
0b5c0ae5cc Add remaining list endpoints 2017-12-13 22:16:10 +01:00
Lorenz Diener
b840766ed7 Add more list endpoints 2017-12-13 21:16:02 +01:00
Lorenz Diener
7cf813b974 Added account_lists(broken) 2017-12-13 18:59:32 +01:00
Lorenz Diener
c9cc873714 Add information about unauthenticated methods 2017-12-13 18:45:28 +01:00
Lorenz Diener
7d2f244126 Add internal links in docs 2017-12-13 18:40:17 +01:00
Lorenz Diener
d7d8f153a3 Update docs for search function 2017-12-13 17:55:14 +01:00
Lorenz Diener
48d54effc8 Add lists endpoint 2017-12-13 17:47:50 +01:00
Lorenz Diener
7ed769b37a Add list streaming 2017-12-13 17:26:44 +01:00
Lorenz Diener
75aebac744 Add custom_emojis 2017-12-13 17:17:42 +01:00
Lorenz Diener
c06baa13b3 Update verify_credentials docs 2017-12-13 17:11:45 +01:00
Lorenz Diener
ce5b0ca576 Update docs, fixes #106 2017-12-11 15:30:24 +01:00
Lorenz Diener
fad615b8d6 Fix versioning functionality more, explicit version check 2017-12-11 14:34:51 +01:00
Lorenz Diener
a93f051b5e Fix instance() 2017-12-11 14:22:35 +01:00
Lorenz Diener
0b701ca6ac Make the version check be not wrong 2017-12-11 14:18:54 +01:00
Lorenz Diener
3bf2299e7e Make decorated functions actually return things 2017-12-11 14:02:57 +01:00
Lorenz Diener
9acfb0d3d8 Versioning fixes 2017-12-11 14:00:14 +01:00
Lorenz Diener
d87ff6d490 Version all endpoints where such a thing makes sense 2017-12-11 12:33:30 +01:00
Lorenz Diener
3ba917d363 Add versionind decorator 2017-12-11 11:49:14 +01:00
codl
050077e97a
fix #111 2017-11-29 22:16:53 +01:00
Lorenz Diener
a7e2caa369 Check hashtags in streaming API 2017-11-29 18:04:54 +01:00
Lorenz Diener
c5970d10f9 Fix the thing I previously broke
lets pretend I was just testing the CI okay
2017-11-29 17:57:04 +01:00
Lorenz Diener
1c64c39701 add hashtag leading # detection, closes #105 2017-11-29 17:54:27 +01:00
Lorenz Diener
32adb8ce4b
Merge pull request #103 from Kjwon15/feature-asyncstream
Implement is_alive to async stream
2017-11-27 13:50:31 +01:00
codl
b9e6a1e9ba
fix string id support to also include in_reply_to_... fields 2017-11-26 22:49:32 +01:00
codl
ca11ef77ac
use six instead of relying on python version 2017-11-26 22:33:08 +01:00
kjwon15
3faf7c6473 Get current thread correctly 2017-11-25 03:09:38 +09:00
kjwon15
fa1840c0fb Implement is_alive to async stream 2017-11-25 02:52:00 +09:00
Lorenz Diener
18f69451ed Merge branch 'master' of https://github.com/halcy/Mastodon.py 2017-11-24 15:26:42 +01:00
Lorenz Diener
9e97fce2d6 Break streaming entirely, update docs 2017-11-24 15:25:38 +01:00
Lorenz Diener
e220e7cc60 Many fixes for streaming stuff 2017-11-24 15:08:34 +01:00
Lorenz Diener
cea4d4251a Change exceptions slightly 2017-11-24 14:20:27 +01:00
Lorenz Diener
de2114b92b BREAKING: Make streaming use json hooks 2017-11-24 13:59:50 +01:00
Lorenz Diener
92adc94a77
Merge pull request #102 from codl/http-streams
fix #101 by checking if the stream api uses ws:// or wss://
2017-11-22 14:29:24 +01:00
codl
c3a31930b8
fix #101 by checking if the stream api uses ws:// or wss:// 2017-11-22 14:14:35 +01:00
Lorenz Diener
8987590545 ID Unpacking 2017-11-22 10:26:44 +01:00
Lorenz Diener
7771b27b72 Document local hashtag timelines 2017-11-21 14:47:13 +01:00
Lorenz Diener
32f8b8bed9 Added support for local hashtag timelines 2017-11-21 14:46:43 +01:00
Lorenz Diener
e1a1592575 Documented report dicts 2017-11-21 14:33:04 +01:00
Lorenz Diener
e31b9441f8 Documentation about visibility fixed (Fixes #55) 2017-11-21 13:59:50 +01:00
Lorenz Diener
39548ffe98 Merge branch 'master' of https://github.com/halcy/Mastodon.py 2017-11-21 13:57:21 +01:00
Lorenz Diener
56ec90f17c
Merge pull request #99 from foozmeat/master
Adds alt text support for media uploads
2017-11-21 13:57:03 +01:00
Lorenz Diener
d303afefc8 Manually merge #94 2017-11-21 13:53:42 +01:00
James Moore
23d57587e4
Added optional media description
This works with the new alt text support in mastodon 2.0.
2017-11-09 11:55:13 -08:00
codl
6b5deb4898
add support for mastodon v2.0's string IDs 2017-11-05 14:17:49 +01:00
Lorenz Diener
61552f9f84 Merge pull request #93 from codl/fix-ratelimit
fix #92, check for throttling by status code, and do it before the catchall error handler
2017-10-16 11:19:49 +02:00
Haisenburg
9a7efa3657 Use urlparse instead of urllib.parse for python2.7 2017-10-08 03:50:19 +08:00
codl
0ff6abf2f4
fix #92, check for throttling by status code, and do it before the catchall error handler 2017-10-04 16:08:21 +02:00
Lorenz Diener
b18b6f201b Merge pull request #89 from Elizafox/exception-hierarchy
Redesign exception hierarchy
2017-10-02 10:13:23 +02:00
Elizabeth Myers
c64617ee94 Redesign exception hierarchy
All Mastodon.py errors now derive from MastodonError, for easier
catching in application code that just wants to see if something
happened, and isn't too miffed about the details.

I/O Errors derive from MastodonIOError, for similar reasons.

This change is designed to be backwards compatible.
2017-09-25 19:11:16 -05:00
Elizabeth Myers
9ec0655365 Properly fix redirecting streaming endpoints.
Fixes #84
2017-09-25 18:01:41 -05:00
Elizabeth Myers
67018b2249 Fix notifications_dismiss by passing parameter correctly 2017-09-18 09:59:35 -05:00
Elizabeth Myers
5b90a3c830 Remove debugging print statements 2017-09-16 10:09:32 -05:00
Elizabeth Myers
6067aa4604 Workaround Mastodon issue with streaming API redirection
Mastodon can be configured to use another address for streaming
server-side. Such a setup is common with certain deployments.

However, due to a bug, Mastodon does not properly issue HTTP redirects
for anything but the endpoint /api/v1/streaming (including subdirs). It
instead gives a 404, causing the request to fail.

The workaround is to hit this path first, checking for any redirects,
and modifying the URL accordingly.

This commit also includes a workaround for behaviour in requests that
causes it to strip the Authorization header from redirected requests.
This is intentional behaviour on the part of requests, but breaks the
redirection done by Mastodon.

Fixes #84
2017-09-16 10:05:44 -05:00
codl
92dd24450d
fix exception in log_in, by accepting json dates as timestamps
when requesting a bearer token, mastodon (more specifically doorkeeper)
returns an object with a created_at attribute which is a plain timestamp
unlike in most of mastodon's api:

{
    "access_token": "hunter2",
    "token_type": "bearer",
    "scope": "read write",
    "created_at": 1504824250,
}
2017-09-10 12:23:54 +02:00
Lorenz Diener
7ded08fd84 Fix for fix 2017-09-08 16:41:39 +02:00
Lorenz Diener
419bedc55a Potential fix for #81 2017-09-08 16:40:43 +02:00
Lorenz Diener
517f47083d Add conversation muting 2017-09-08 16:34:11 +02:00
Lorenz Diener
982fde2b56 Add date parsing 2017-09-08 16:27:16 +02:00
Lorenz Diener
df26310d1b Add notification dismissal 2017-09-08 15:25:49 +02:00
Lorenz Diener
81e2b4b4ab Change default ratelimit back to 300 2017-09-08 15:06:31 +02:00
Lorenz Diener
7de02fe5b8 Merge branch 'master' into async_streaming 2017-09-08 15:02:58 +02:00
Lorenz Diener
0edc424b11 Clarify visibility documentation 2017-09-08 14:51:07 +02:00
Lorenz Diener
c628ff4f05 Small documentation fix for toot() 2017-09-08 14:49:57 +02:00
Lorenz Diener
74cb10eeff Merge branch 'master' into master 2017-09-08 13:44:30 +02:00
lambadalambda
71d1038b32 Send params as part of the query in GET requests
Using the data argument will send them form-encoded like for the other requests, which isn't parsed by many servers for GET requests.
2017-09-08 07:45:23 +02:00
FoxMaSk
6ef2724f66 not pep8 compliant #71 2017-09-05 23:07:24 +02:00
FoxMaSk
e0e68ccd6a not pep8 compliant #71 2017-09-05 22:59:32 +02:00
Lorenz Diener
c8490be2a7 Streams are requested via GET (Fixes #50) 2017-09-05 16:45:24 +02:00
Lorenz Diener
1c93e350f7 Fix crash on URLs with no 'rel' attribute (Fixes #79) 2017-09-05 16:39:17 +02:00
Lorenz Diener
87ee1df1c0 Fix #59 2017-09-05 16:36:32 +02:00
Lorenz Diener
613ad895c8 Fix copy-paste errors in fetch_* methods (fixes #57) 2017-09-05 16:33:13 +02:00
Lorenz Diener
02d9f5196c Fix fetch_* methods modifying their parameters 2017-09-05 16:19:27 +02:00
Elizabeth Myers
a76eafbd46 Remove trailing slashes in base URL
The streaming API can't handle multiple slashes in the lead of a path
request. This is probably a bug in Mastodon, but should be worked around
here for now.
2017-08-19 05:49:08 -05:00
Chronister
4a5302e03a Return a one-off handle instead of the Response object 2017-08-13 18:10:04 -07:00
Chronister
a6a1ddbed1 Add async parameter to streaming API calls. If true, calls the streaming API on a separate thread and returns the Response object to the user so they can close it at their discretion. 2017-08-12 22:21:37 -07:00
Lorenz Diener
fccc4e1986 Merge pull request #67 from Chronister/handle_empty_link
Handle case of empty 'Link' header from server
2017-08-12 12:44:56 +02:00
Chronister
4efebe2c9f Handle case of empty 'Link' header from server 2017-08-11 17:40:04 -07:00
Logan Fick
5943038be3
Fixed clearing notifications raising endpoint not found. 2017-07-31 00:29:45 -04:00
Zac
71791ccd1d fixed incorrect rate limit amount
related area in Mastodon code: 056b5ed72f/config/initializers/rack_attack.rb (L12)
2017-07-11 22:53:01 -04:00
Lorenz Diener
d4b37995fe Pagination 2017-06-16 01:23:19 +02:00
Lorenz Diener
df98fc263e Auto-add protocol to URLs that do not have one. Fixes #54 2017-06-15 23:34:11 +02:00
Lorenz Diener
5e0cf05330 Typo fix 2017-06-15 23:15:38 +02:00
Lorenz Diener
aa3e678c7b Domain blocking + documentation 2017-06-15 23:13:34 +02:00
Lorenz Diener
b57b66ebb5 More doc fixes, instance dictionaries 2017-06-15 22:48:23 +02:00
Lorenz Diener
d5bb2418a9 More fixes to documentation 2017-06-15 22:32:17 +02:00
Lorenz Diener
03e19e3655 Small documentation adjustments 2017-06-15 20:48:59 +02:00
Lorenz Diener
5ed78fbe83 Merge pull request #53 from brrzap/expand-params
expand parameters in notifications/favourites/blocks/mutes
2017-05-19 10:08:57 +02:00
Lorenz Diener
3031906743 Merge pull request #52 from brrzap/docfix-issue-51
fix doc on follow_request_{authorize,reject}
2017-05-19 10:08:40 +02:00
@brrzap
7df35c4807 expand notifications/favourites/blocks/mutes arguments
* adds max_id, since_id, limit parameters to existing functions
2017-05-14 01:24:46 -04:00
@brrzap
14589563bb fix doc on follow_request_{authorize,reject} 2017-05-09 01:43:48 -04:00
fumi-san
c57ad7f6b9 Add local_stream method for getting local streaming timeline.
There was no way to get local streaming timeline.
Add 'local_stream' method whose behavior is like 'public_stream' method.
2017-05-05 17:23:12 +09:00
Alex McGivern
91e5388dae added content-type hint
fixed POST parameters for reports
added handling for PATCH requests
added check for missing Date header to prevent errors when testing against Puma
2017-04-27 00:21:32 +01:00
Alex McGivern
973182cda0 account_update_credentials uses PATCH, not POST 2017-04-26 23:13:49 +01:00
Alex McGivern
00998d6d46 Merge branch 'master' of https://github.com/halcy/Mastodon.py 2017-04-26 13:13:17 +01:00
Alex McGivern
911fcc733c added calls for fetching instance data, status cards, filing reports, and updating the user profile 2017-04-26 13:02:40 +01:00
Lorenz Diener
0ba01f3da9 Cleaned documentation up somewhat 2017-04-26 13:29:34 +02:00
Lorenz Diener
23e796bab4 Fixed follows docs 2017-04-26 13:24:27 +02:00
Lorenz Diener
28553d7a69 Housekeeping 2017-04-26 12:20:44 +02:00
Lorenz Diener
7cfb17d698 Documentation and consistence changes 2017-04-26 12:19:41 +02:00
Lorenz Diener
4a2f6d0fb9 Added some missing API methods 2017-04-26 11:56:47 +02:00
Lorenz Diener
6a2c394c50 Restored python 2 compatibility 2017-04-26 11:43:16 +02:00
Lorenz Diener
67aa919f40 Merge pull request #45 from naoyat/add_account_following_params
Added since_id/max_id/limit params to account_following()/account_followers()
2017-04-26 11:16:11 +02:00
naoya_t
a8d5ee75c1 mastodon/Added since_id/max_id/limit params to account_following()/account_folowers() 2017-04-26 11:51:24 +09:00
naoya_t
01b4d113bc Added remote follow support, resolves issue #40 2017-04-26 11:49:56 +09:00
Lorenz Diener
fde6806120 Documentation fixes to address #21 2017-04-25 11:41:48 +02:00
Lorenz Diener
5aeb953d24 Remove additional traceback print 2017-04-25 11:36:49 +02:00
Eliot Berriot
d8adb28cde Added direct level for status privacy 2017-04-24 22:02:26 +02:00
Ansem
61f014f322 Add scope param to log_in(), resolves issue #35 2017-04-20 14:32:40 +00:00
Christopher Su
8f0d872119 Remove the mentions timeline because it doesn't exist 2017-04-15 00:53:58 -07:00
Ansem
7c7cf8478d Add general error message 2017-04-11 10:37:15 +02:00
Ansem
e51e5cc521 Fix auth request, now able to specify needed scope for the client 2017-04-11 10:36:58 +02:00
Lorenz Diener
ccaaea0072 Fixing mistake from earlier merge 2017-04-10 17:14:37 +02:00
Lorenz Diener
965d514de1 Merge branch 'master' into streaming 2017-04-10 10:33:25 +02:00
Lorenz Diener
7db6b4c02e Merge pull request #26 from phryk/master
added content_search, probably.
2017-04-10 10:29:55 +02:00
Lorenz Diener
98f636f581 Merge pull request #27 from azillion/master
Add support for OAuth2, resolves issue #6
2017-04-10 10:28:50 +02:00
Will Thompson
ab60931620
Initial implementation of streaming API
This is missing any error handling and rate-limiting around the stream
itself, but once the stream is established, the full range of events are
supported.

Fixes issue #14.
2017-04-10 08:18:08 +01:00
Ed Summers
c45a1af5e1 fix ValueError
checking if media_type is defined will short circuit the
the call to os.path.isfile when content is supplied

fixes #28
2017-04-09 17:58:46 -04:00
Ansem
cb6e304043 Fix write access_token to file mistake 2017-04-07 22:06:06 +00:00
Ansem
ebfe65a295 Add support for OAuth2 2017-04-07 21:59:39 +00:00
phryk
7ebc48c50e added content_search, probably. 2017-04-07 15:12:24 +02:00
Lorenz Diener
0cac499cfe Sensitive = False results in Not Sensitive. Fixes #20 2017-04-05 13:54:21 +02:00
Will Thompson
2015cde528 Fix typo in Mastodon.__init__ docstring 2017-04-05 10:32:46 +01:00
Lorenz Diener
1fc7c465b3 Merge pull request #15 from erincongden/newfeatures
Muting, follow requests, local timeline, and more
2017-04-03 12:05:10 +02:00
Lorenz Diener
d8ac59f4eb Merge branch 'master' into typo 2017-04-03 12:02:17 +02:00
Erin Congden
ca0b6c115b Added follow requests support 2017-04-02 21:53:25 -07:00
Erin Congden
38ebcda76b Added getting a list of favourited toots 2017-04-02 21:52:45 -07:00
Erin Congden
36781699c1 Add (un)muting accounts and reading mutes/blocks 2017-04-02 21:52:41 -07:00
Erin Congden
9eaf955bfc Added local timeline support 2017-04-02 21:25:11 -07:00
Erin Congden
f734a45fb6 Added spoiler text support 2017-04-02 21:14:07 -07:00
Laurent Peuch
95275bb391 [mod] typo 2017-04-01 15:04:45 +02:00
Laurent Peuch
1d76bc150a [mod] show real exception for easier debugging 2017-04-01 14:13:46 +02:00
Tyler Britten
be6c248a21 fixed missing change
removed self. from request_timeout- missed this commit in the last PR
2017-03-03 11:23:11 -05:00
Tyler Britten
9a1c7a7147 fixed missing request_timeout on app creation 2017-03-03 11:10:04 -05:00
Florian Piesche
963ec9c5f2 Implement PR feedback and cull trailing whitespace
Default post privacy to match account privacy setting. Remove sensitive/visibility parameters from simple toot() function.
2017-01-27 13:16:13 +00:00
Florian Piesche
f60ff60e13 Add support for sensitive toots and visibility settings. 2017-01-23 11:11:55 +00:00
Lorenz Diener
19a1b014d4 Added timeout 2016-12-13 17:17:33 +01:00
Lorenz Diener
6f923ad1f9 media_ids can not just be dicts, for extra lazyness 2016-11-26 00:03:19 +01:00
Lorenz Diener
69f78773a0 Requirement and documentation fixes 2016-11-25 23:28:30 +01:00
Lorenz Diener
61775d9083 Rate limiting now works. 2016-11-25 23:14:00 +01:00
Lorenz Diener
ab58894041 Merge remote-tracking branch 'refs/remotes/origin/master' into ratelimits
# Conflicts:
#	mastodon/Mastodon.py
2016-11-25 20:57:53 +01:00
Lorenz Diener
6fdf18eebc Documentation for notifications 2016-11-25 20:46:20 +01:00
Lorenz Diener
3585830182 Documentation restructured and made more PEP8-y 2016-11-25 20:33:00 +01:00
Lorenz Diener
e4e3a8eb93 Ratelimit code 2016-11-25 18:17:39 +01:00
Lorenz Diener
2729ca1931 More "timeline" functions, "notifications" 2016-11-25 15:39:53 +01:00
Lorenz Diener
d6bbd27153 Fixed bug in debug code 2016-11-24 20:07:00 +01:00
Lorenz Diener
2267e51efd Fixed a bug in account_statuses 2016-11-24 20:03:08 +01:00
Lorenz Diener
78120bed1b Media uploads tentatively working 2016-11-24 12:34:31 +01:00
Lorenz Diener
20f5249c7d Documented new error handling code 2016-11-24 12:08:32 +01:00
Lorenz Diener
ead7b7fc5e Fixed login scope check 2016-11-24 12:07:41 +01:00
Lorenz Diener
68899a0cc4 Added some error handling to log_in 2016-11-24 12:03:42 +01:00
Lorenz Diener
3a92948158 __init__.py fixed 2016-11-24 11:51:25 +01:00
Lorenz Diener
04406738f2 Docs are now good 2016-11-24 03:03:52 +01:00
Lorenz Diener
615f88154c Further readjustment. Docs now actually build, but look bad. 2016-11-24 02:07:08 +01:00