1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Twitter/Tweets/Create-image-tweet.md
T
Vitaly the Alpaca (bot) 32da034900 Main build (Jenkins)
2024-10-05 13:56:38 +03:00

1.5 KiB

sidebar_position
sidebar_position
2

Create image tweet

Creates a tweet with an image attachment

Function CreateImageTweet(Val Text, Val ImageArray, Val Parameters = "") Export

Parameter CLI option Type Description
Text --text String Tweet text
ImageArray --pictures Array of String, BinaryData Image files array
Parameters --auth Structure Of String Auth data or path to .json file

Returns: Map Of KeyAndValue - serialized JSON response from Twitter


    Parameters = GetTwitterAuthData();
    Text       = "TestTweet" + String(New UUID);

    Image  = "https://openyellow.neocities.org/test_data/picture.jpg"; // URL, Binary or Path to file
    Image2 = "https://openyellow.neocities.org/test_data/picture2.jpg"; // URL, Binary or Path to file

    ImageArray = New Array;
    ImageArray.Add(Image);
    ImageArray.Add(Image2);

    Result = OPI_Twitter.CreateImageTweet(Text, ImageArray, Parameters);

    Text   = "TestTweet" + String(New UUID);
    Result = OPI_Twitter.CreateImageTweet(Text, Image, Parameters);
    
  oint twitter CreateImageTweet --text %text% --pictures %pictures% --auth %auth%

{
 "data": {
  "edit_history_tweet_ids": [
   "1840435469219209570"
  ],
  "id": "1840435469219209570",
  "text": "TestTweet5638e27b-1d6f-41f9-ab12-ee3f5b28f759"
 }
}