This project has moved. For the latest updates, please go here.

Replying with Media

Sends a reply with attached media.
Signature:
public static Status ReplyWithMedia(this TwitterContext twitterCtx, ulong inReplyToStatusID, string status, bool possiblySensitive, List<Media> mediaItems)

public static Status ReplyWithMedia(this TwitterContext twitterCtx, ulong inReplyToStatusID, string status, bool possiblySensitive, decimal latitude, decimal longitude, string placeID, bool displayCoordinates, List<Media> mediaItems, Action<TwitterAsyncResponse<Status>> callback)
Parameters/Filters:
Name Purpose Type Required
callback Twitter async callback Action<TwitterAsyncResponse<Status>> callback no
displayCoordinates Display coordinates or not bool no
inReplyToStatusID ID of status replying to ulong no
latitude Status location latitude decimal no
longitude Status location longitude decimal no
mediaItems List of attached media string yes
placeID Twitter place ID string no
possiblySensitive Sensitive to audiences or not bool no
status Text of status to send string yes


Return Type: Status
Example:
            string status = "Testing ReplyWithMedia #Linq2Twitter £ " + 
                DateTime.Now.ToString(CultureInfo.InvariantCulture);
            const ulong InReplyToStatusID = 7680619122;
            const bool PossiblySensitive = false;
            const decimal Latitude = StatusExtensions.NoCoordinate; //37.78215m;
            const decimal Longitude = StatusExtensions.NoCoordinate; // -122.40060m;
            const bool DisplayCoordinates = false;

            const string ReplaceThisWithYourImageLocation = @"..\..\images\200xColor_2.png";

            var mediaItems =
                new List<Media>
                {
                    new Media
                    {
                        Data = Utilities.GetFileBytes(ReplaceThisWithYourImageLocation),
                        FileName = "200xColor_2.png",
                        ContentType = MediaContentType.Png
                    }
                };

            Status tweet = twitterCtx.ReplyWithMedia( InReplyToStatusID,
                status, PossiblySensitive, Latitude, Longitude,
                null, DisplayCoordinates, mediaItems, null);

            Console.WriteLine("Media item sent - Tweet Text: " + tweet.Text);

Twitter API: statuses update_with_media

Last edited Jun 11, 2013 at 9:02 PM by JenniferMayo, version 2