View Single Post
Texrat's Avatar
Posts: 11,700 | Thanked: 10,045 times | Joined on Jun 2006 @ North Texas, USA
#4
Pseudocode:

Code:
Chunk count = 0 //x
Chunk total = 0 //y
Capture text content of comment form
  Trigger POST method of comment form
    Capture page url after update
    Create short url of page url via bit.ly
    Save length of bit.ly url in numeric variable
    authenticate user in twitter
      While not end of comment text
        chunk count = chunk count + 1
          parse comment text until chunk is built:
            chunk max length = 140 - ((bit.ly url + 1) + len("x/y") + 1)
            // x = chunk number
            // y = chunk total
           // chunk needs to take spaces into account--
           // break chunks on spaces, never any other character
           // this means chunks will often be less than 140 characters
           chunk = x/y + " " + tempchunk + " " +bit.ly.url
         end parse
         chunk total = chunk total + 1
         delete chunk text from overall comment
         submit chunk as tweet
       end while
 
cleanup/close
let me know if I missed anything! This is pretty rough
__________________
Nokia Developer Champion
Different <> Wrong | Listen - Judgment = Progress | People + Trust = Success
My personal site: http://texrat.net

Last edited by Texrat; 2009-12-16 at 23:15.