| Issue 195: | Impemented a Tweet Splitter for tweets longer than 140 char | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Very cool project. I just downloaded it and added a feature to my local witty that will automatically split long tweets into multiple tweets. When you create a tweet that is longer than 140 char (after URL shortening) this feature will break the tweet up and send multiple tweets. It also deals with directs and replies by adding the address to every tweet that is created during the split. I made a small modification to MainWindow.xaml.cs and added a new file called TweetSplitterHelper.cs. I'm sure there is a better spot for this functionality if I knew the code better. It also needs a setting to turn this functionality on and off. Feel free to use it or not. Thanks again for Open Sourcing this. ...Ed P.S. Serach for @emcpadden to see the code changes I made to MainWindow.xaml.cs
,
Jan 28, 2009
Thanks bgriswold. It a little rough because I have magic numbers that really should be a constant somewhere, I just wasn't sure where you put those types of things. Anyway, the general idea works. Hope this helps.
,
Jan 28, 2009
Hi Ed, I've done some testing and noticed a couple of things. Tweets are being split at the correct character limit, but I don't think words should be split. I also don't think the Splitter is considering direct messages or replies which should prefix the recipient user name with "@" or "D" on each split tweet. I'm planning to do some work on this this evening. Let me know if you want to jump on these items in the interim.
,
Jan 28, 2009
Sorry about that, I just was off by one on an index. I didn't catch it before because I tested it with lipsum orem generated text so I didn't notice the words were cutting in the wrong place. I also added the @ and D addresses to the beginning of each split tweet taking care to make sure it fell within the 140 limit. This was there so this should have worked...weird. Anyways I attached the changed file...thanks for looking at this! ...Ed
,
Jan 29, 2009
Hi Ed, No worries. Thanks for the updates. I wish I checked in earlier as I started updating the logic a bit myself. I'll check out your changes in the morning. For now, I'm attaching my code (not yet committed) if you would like to review. I think it's a nice combination of both of our work. Thanks again for the contribution. By the way, I noticed your MainWindow.xml.cs was out of date. You may want to get latest.
,
Jan 29, 2009
Ed, I'll echo Ben here - great to see you contributing, it's very much appreciated! It'll be a little easier to get your changes integrated if you can create patches. Scott Hanselman wrote a great (if overly thorough) walkthrough on that here: http://www.hanselman.com/blog/ExampleHowToContributeAPatchToAnOpenSourceProjectLikeDa sBlog.aspx That's not a requirement - we're happy to take your code contributions as you've been sending them. But if you can submit them as patches, we'd be even happier. :-)
,
Jan 29, 2009
No problem Ben and Jon. I'd be more than happy to create a patch. I've never contributed to Open Source so thanks for sending URL to Scott's how to post. I will put together a patch and send it back to you.
,
Jan 29, 2009
Hey Ben and Jon, I just created a patch for this on top of the latest trunk. I also made the code a lot more production ready. I wasn't sure where to put some options so I ended up putting them on the IServiceApi so they could be accessed from anywhere although I don't think that is where they are supposed to go. I have this feature turned on by default but it would seem to me that there should be some user selectable option that would allow the user to determine if they want this behavior. Once you have a look and everything gets into the right place I could take this further to add the UI necessary to make this a selectable option...let me know if you would like me to do that. In any case, glad I could contribute to such a interesting project, hopefully, I'll think of other useful features as I use it more. Also, if I do submit other patches in the future, is this the right place for me to post them to you guys or is there someplace else I should be doing this?
,
Jan 29, 2009
Hi Ed, This is the place continue submitting patches (under the appropriate issue, of course.) When you submit you might want to CC me and/or Jon on the comment. As for the patch, I'll review your changes as well as mine with Jon and determine when and what (read: how much) functionality should be committed. Jon, I'm particularly interested in making sure we aren't missing any message type edge cases. For example, handling replies to more than one user at a time. Thanks, Ben
Cc: jongalloway
,
Jan 29, 2009
Sounds good Ben. Whatever in there helps the cause you are welcome to. Don't hesitate to ask any questions about what I did if you need to. I'd be curious what edge-cases I missed, for future reference. One other question: How do I cc you and Jon in the future? I couldn't see how to do that from this web interface. Thanks Guys, ...Ed
,
Jan 30, 2009
Hi Ed, You are able to send your issue comments to other contributors by including their usernames in the "New Comment" CC field. Both Jon and I can be found in the list. Thanks.
,
Jan 30, 2009
It's funny, I don't have a CC field that is part of this "Add a Comment" box. Maybe its because I am not a member/contributor. No problem...If I put new comments on new issues i will ping you in Twitter to let you know. If you did need to discuss any of this with me I can be reached on Skype at: emcpadden . Again, use or don't use whatever work for you... glad to help if possible but I certainly don't want to make anymore work for anyone.
,
Jan 31, 2009
Committed on 1/31/2009 by Ben Griswold
Status: Fixed
|
||||||||||
| ► Sign in to add a comment | |||||||||||
Owner: bgriswold