views:

37

answers:

0

I have an ActivityStream that sends messages to Twitter. There is a short and long format for each message. It's possible that both could be over 140 chars, but the short format has much lower probability. By default, I start with the long version, then if that is over 140 chars, I use the short version. Again, there's a chance the short could be over 140 chars. If it is, I need to send notification to hoptoad.

I could use some help on the logic and control structure to use to accomplish the following:

  1. The streamer retrieves the long message format.
  2. Checks whether it's valid size.
  3. If so, message is posted.
  4. If it's over 140 chars, then short message format is retrieved.
  5. Checks whether it's valid size.
  6. If so, message is posted.
  7. If not, hoptoad notification is sent.