[twitter-dev] Re: Formats for specifying annotations
Hi, 1) annotations shouldn't go via the GET method 2) if we to reserve characters then the pipe will be the one 3) allow multiple fields be combined automatically in the POST: annotations=domain|attribute1|value1& annotations=domain|attribute2|value1 4) encoding will be needed anyway, so why not go with the html-encoded POST On May 17, 8:15 pm, "M. Edward (Ed) Borasky" wrote: > On Monday, May 17, 2010 11:54:41 am @epc wrote: > > > > > On May 17, 1:35 pm, Marcel Molina wrote: > > > Hey folks. I'd like to get your advice on the Annotations feature. > > > Initial feedback: > > - I'd use a shorter variable name > > - Instead of using "annotations" once, allow repeated instances, each > > instance being a new annotation. > > > | We want to allow you to use any arbitrary set of bytes for the > > > type, > > > | attribute names and attribute values of an annotation. > > > I think you need to rethink this a little, at least declare a set of > > reserved characters. > > > If you reserved ":" for example, you could reduce this down to: > > > annotations=type:attribute:value > > (and yes, that'd mean that "value" could potentially be double-URL > > encoded/decoded if it has a ":" in it). So your example would be: > > twurl /1/statuses/update.xml -d "status=Tweet with annotations! > > &annotations=movie:title:Terminator > > 2&annotations=movie:url=http://www.imdb.com/title/tt0103064/"; > > > I can't find anything to back up this but I believe that POST data is > > ordered. If so you could alternately do: > > annotation=type:attribute > > annotation_val = value > > > twurl /1/statuses/update.xml \ > > -d "status=Tweet with annotations! > > &annotations=movie:title&annotations_value=Terminator > > 2&annotations=movie:url&annotations_val=http://www.imdb.com/title/ > > tt0103064/" > > > …which would avoid the need to double URL escape the annotation value. > > > Can types use UTF8? Attributes? Values? > > > Could I post "annotations=映画:言語:英語" (or annotations==映画:言語=英語 in your > > original notation)? > > (I'm hoping that reads "annotations=movie:language:english" in > > Japanese. Apologies if it does not.) > > -- > > -ed costello > > What are the constraints? We're just talking about serializing / marshalling > objects here, right? Documents? Trees? Or are we talking about an API for > creating / modifying objects / documents / trees? > > As long as you're constrained to (UTF8) characters, I don't see any reason not > to use JSON for objects. Now if *binary* is allowed, well ... seems like the > only issue is little-endian vs. big-endian. ;-) > > -- > M. Edward (Ed) Boraskyhttp://borasky-research.net/m-edward-ed-borasky/@znmeb > > "A mathematician is a device for turning coffee into theorems." ~ Paul Erdős
Re: [twitter-dev] Re: Formats for specifying annotations
On Monday, May 17, 2010 11:54:41 am @epc wrote: > On May 17, 1:35 pm, Marcel Molina wrote: > > Hey folks. I'd like to get your advice on the Annotations feature. > > Initial feedback: > - I'd use a shorter variable name > - Instead of using "annotations" once, allow repeated instances, each > instance being a new annotation. > > | We want to allow you to use any arbitrary set of bytes for the > > type, > > | attribute names and attribute values of an annotation. > > I think you need to rethink this a little, at least declare a set of > reserved characters. > > If you reserved ":" for example, you could reduce this down to: > > annotations=type:attribute:value > (and yes, that'd mean that "value" could potentially be double-URL > encoded/decoded if it has a ":" in it). So your example would be: > twurl /1/statuses/update.xml -d "status=Tweet with annotations! > &annotations=movie:title:Terminator > 2&annotations=movie:url=http://www.imdb.com/title/tt0103064/"; > > I can't find anything to back up this but I believe that POST data is > ordered. If so you could alternately do: > annotation=type:attribute > annotation_val = value > > twurl /1/statuses/update.xml \ > -d "status=Tweet with annotations! > &annotations=movie:title&annotations_value=Terminator > 2&annotations=movie:url&annotations_val=http://www.imdb.com/title/ > tt0103064/" > > …which would avoid the need to double URL escape the annotation value. > > Can types use UTF8? Attributes? Values? > > Could I post "annotations=映画:言語:英語" (or annotations==映画:言語=英語 in your > original notation)? > (I'm hoping that reads "annotations=movie:language:english" in > Japanese. Apologies if it does not.) > -- > -ed costello What are the constraints? We're just talking about serializing / marshalling objects here, right? Documents? Trees? Or are we talking about an API for creating / modifying objects / documents / trees? As long as you're constrained to (UTF8) characters, I don't see any reason not to use JSON for objects. Now if *binary* is allowed, well ... seems like the only issue is little-endian vs. big-endian. ;-) -- M. Edward (Ed) Borasky http://borasky-research.net/m-edward-ed-borasky/ @znmeb "A mathematician is a device for turning coffee into theorems." ~ Paul Erdős
[twitter-dev] Re: Formats for specifying annotations
On May 17, 1:35 pm, Marcel Molina wrote: > Hey folks. I'd like to get your advice on the Annotations feature. Initial feedback: - I'd use a shorter variable name - Instead of using "annotations" once, allow repeated instances, each instance being a new annotation. | We want to allow you to use any arbitrary set of bytes for the type, | attribute names and attribute values of an annotation. I think you need to rethink this a little, at least declare a set of reserved characters. If you reserved ":" for example, you could reduce this down to: annotations=type:attribute:value (and yes, that'd mean that "value" could potentially be double-URL encoded/decoded if it has a ":" in it). So your example would be: twurl /1/statuses/update.xml -d "status=Tweet with annotations! &annotations=movie:title:Terminator 2&annotations=movie:url=http://www.imdb.com/title/tt0103064/"; I can't find anything to back up this but I believe that POST data is ordered. If so you could alternately do: annotation=type:attribute annotation_val = value twurl /1/statuses/update.xml \ -d "status=Tweet with annotations! &annotations=movie:title&annotations_value=Terminator 2&annotations=movie:url&annotations_val=http://www.imdb.com/title/ tt0103064/" …which would avoid the need to double URL escape the annotation value. Can types use UTF8? Attributes? Values? Could I post "annotations=映画:言語:英語" (or annotations==映画:言語=英語 in your original notation)? (I'm hoping that reads "annotations=movie:language:english" in Japanese. Apologies if it does not.) -- -ed costello