Comments (15)
Hmm. We probably should do something like this. Maybe with an 'auto_split' flag
or
something?
Original comment by dclinton
on 19 Feb 2009 at 4:07
- Changed state: Accepted
from python-twitter.
I believe this should be automatic, so the user didn't get bored with error
messages,
or, instead of an error, raise an alert, asking the user to use this
'auto_split'
flag/feature for larger messages than 140c, sure.
Should I submit a patch with this flag?
Any other observations?
Original comment by stockrt
on 19 Feb 2009 at 4:16
from python-twitter.
I'd vote for an 'auto_split' flag like dclinton suggested. The 140 character
limit is
well-known, and people would probably expect to have some kind of warning or
error
that they hit that limit unless they explicitly chose to have their messages
split up.
Original comment by [email protected]
on 19 Feb 2009 at 7:06
from python-twitter.
I agree with dclinton and brad.cavanagh...there should be an optional parameter
to
PostUpdate to enable this behavior. By default it should raise an error as
before.
Principle of least surprise: user text should not be munged unless user
requested the
munging feature be turned on.
I really like the sample output; this is an attractive way of splitting
updates, and
I like that you did it at word boundaries.
Original comment by [email protected]
on 20 Feb 2009 at 3:59
from python-twitter.
Original comment by [email protected]
on 20 Feb 2009 at 4:00
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from python-twitter.
People, there is the patch using an option flag for the api.PostUpdate() method:
..
+ def PostUpdate(self, text, auto_split=False):
..
+ if len(text) > max_size and not auto_split:
+ raise TwitterError("Text must be less than or equal to %d characters.
Consider
using 'auto_split' option." % max_size)
..
Regards,
Rogério Schneider
Original comment by stockrt
on 23 Feb 2009 at 5:25
Attachments:
from python-twitter.
Hey, here is a patch working with the latest rev132, commited today. I did the
merge,
and testing was ok.
Regards,
Rogério Schneider
Original comment by stockrt
on 26 Feb 2009 at 3:53
Attachments:
from python-twitter.
I have some comments about the code itself. Are you comfortable with me
changing
things before applying it?
Original comment by dclinton
on 26 Feb 2009 at 4:08
from python-twitter.
For sure I am! You can change this the way you need to better fit python-twitter
standards.
The comments you have, can you share?
Original comment by stockrt
on 26 Feb 2009 at 4:12
from python-twitter.
I checked in my own implementation of this in r133:
http://code.google.com/p/python-twitter/source/detail?r=133
I decided to create a new method called 'PostUpdates', rather than use an
'auto_split' flag on the original 'PostUpdate' method. The reason being that
multiple updates require a list of Status instances as a return value, where as
the
existing PostUpdates returns only a single instance. So rather than have one
method
return both a list and a single Status, I just created a new method.
Please review the changes at your convenience.
Original comment by dclinton
on 1 Mar 2009 at 8:11
- Changed state: Fixed
from python-twitter.
Also just added the feature to provide a continuation string to messages that
are
split. It defaults to None, but try calling PostUpdates with continuation='
…' for a
nice example.
Original comment by dclinton
on 1 Mar 2009 at 10:36
from python-twitter.
The implementation is very nice. I confess I didn't know 'textwrap' module
before.
Another learning time for me. Multiple results as return are also the correct
way to
do it.
Thanks for commiting.
Regards,
Rogério Schneider
Original comment by stockrt
on 2 Mar 2009 at 3:03
from python-twitter.
DeWitt, I would like to observe some points in this solution.
- You didn't place a 'reverse post order', so it would be more easy to read the
posts
in user's page. First line of the splited message should be posted by last.
- The 'continuation' is placed in the wrong place, if we try to revert the post
order. for example, the last post should not have this continuation, since it
is the
last post.
My code addressed this issues, can you check?
Regards,
Rogério Schneider
Original comment by stockrt
on 2 Mar 2009 at 3:46
from python-twitter.
Thanks, Rogério. I don't reverse on purpose because the posts will arrive in
chronological ordering, which feels more correct in the normal use case.
Reversing
just so they show up in order top to bottom in certain clients (like
twitter.com)
seems like the wrong fix. If you feel strongly about this I could add a
'reverse'
option that defaults to False.
Original comment by dclinton
on 2 Mar 2009 at 4:06
from python-twitter.
That is ok the way it is. Thanks again.
Original comment by stockrt
on 6 Mar 2009 at 2:54
from python-twitter.
Related Issues (20)
- Patch for /twitter.py
- TwitterHTTPError HOT 1
- geocode does not return the right location for GetSearch HOT 1
- Follower info for user, not self
- twitter.Api.GetTrendsCurrent() does not work HOT 2
- creating /tmp/python.cache_<USER_NAME> and not deleting it. HOT 2
- [patch] Add exclude_replies parameter to GetUserTimeline HOT 1
- Failed to catch twitter api errors (current code checks for error)
- AttributeError: 'unicode' object has no attribute 'get' in NewFromJsonDict() HOT 1
- How to start?
- Can't encode ! It can't READ!
- Update needed in Pypi HOT 10
- Patch: adding support for include_entities in the GetSearch() function HOT 1
- twitterApi will return exception which are not twitter exceptions HOT 1
- python-twitter throws KeyError
- AttributeError: 'unicode' object has no attribute 'get' HOT 1
- Character Limit does not accurately match URL t.co wrapper
- NewFromJsonDict AttributeError HOT 2
- "UnicodeEncodeError: 'ascii' codec can't encode characters" during GetSearch() for utf-8 encoded search terms
- Current head (dca91beb7418) has a failing unit test HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-twitter.