Git Product home page Git Product logo

Comments (15)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024

Original comment by [email protected] on 20 Feb 2009 at 4:00

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 23, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.