Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Wishlist
  3. Twitter crossposter

Twitter crossposter

Scheduled Pinned Locked Moved App Wishlist
39 Posts 4 Posters 5.1k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • robiR robi

    @timconsidine So this is after the config tweak?

    Yes, images/videos would be a useful/required thing.

    Why are there two twitter accounts?

    timconsidineT Offline
    timconsidineT Offline
    timconsidine
    App Dev
    wrote on last edited by
    #17

    @robi yes, I set the environment variable rather than downgrade.
    And then it just sailed through.

    The 1st twitter account is more of an organisation account and the 2nd twitter account is an individual account.
    I mostly wanted to test that I could auto-RT another account.
    The Set1 grabs the tweet id returned by Twitter on posting, and the 2nd account RT's that tweet id.
    Not hugely useful but I wanted to prove it could be done.
    The Wait is just to provide an 'air gap' of sorts in case it all goes through too quickly for systems to cope.

    Screenshot 2021-09-26 at 23.08.15.png

    Images are now added.
    Docs/forum say HTTP Request node needed for that.

    And as the RSS feed returns a list of toots, I needed to avoid duplicate posts. So I added an IF node which tests if a toot is older than xxx milliseconds (5 mins in my case), and only continues if it is newer. If none newer, the flow expires (no false tree set up).

    Now I just need to add a cron or scheduler node.
    But leaving it manual firing for now to test edge cases which different content might show errors on.

    rmdesR 1 Reply Last reply
    2
    • robiR robi

      @timconsidine You are very welcome!

      I will be interested in some of the things you learn there as well, as I'd like to connect Insta posting to Twitter posting and not necessarily from the same account(s).

      timconsidineT Offline
      timconsidineT Offline
      timconsidine
      App Dev
      wrote on last edited by timconsidine
      #18

      @robi said in Twitter crossposter:

      I'd like to connect Insta posting to Twitter posting and not necessarily from the same account(s)

      I don't use Instagram but ironically just found one of my 'persons of interest' does, and mostly tweets links to Insta posts. So you have to follow them to see content. So I may look into this.

      Brief research shows you can use Bibliogram to get an RSS feed of Instagram posts from an Insta account. Based on that, it seems at first glance that it is possible to use similar workflow to my Mastodon2Twitter to achieve that.

      I tried briefly to self-host Bibliogram but installation failed, so as Instagram is low usage for me, I'm just using a hosted Bibliogram (https://bibliogram.snopyta.org/) to give me the RSS feed.

      EDIT : just seen Bibliogram is a supported app on Yunohost. I don't have a Yunohost server .... yet !

      robiR 1 Reply Last reply
      2
      • timconsidineT timconsidine

        @robi said in Twitter crossposter:

        I'd like to connect Insta posting to Twitter posting and not necessarily from the same account(s)

        I don't use Instagram but ironically just found one of my 'persons of interest' does, and mostly tweets links to Insta posts. So you have to follow them to see content. So I may look into this.

        Brief research shows you can use Bibliogram to get an RSS feed of Instagram posts from an Insta account. Based on that, it seems at first glance that it is possible to use similar workflow to my Mastodon2Twitter to achieve that.

        I tried briefly to self-host Bibliogram but installation failed, so as Instagram is low usage for me, I'm just using a hosted Bibliogram (https://bibliogram.snopyta.org/) to give me the RSS feed.

        EDIT : just seen Bibliogram is a supported app on Yunohost. I don't have a Yunohost server .... yet !

        robiR Offline
        robiR Offline
        robi
        wrote on last edited by
        #19

        @timconsidine Beautiful, nice find on bibliogram.

        I was looking at other such services and Nitter showed up, with a bit more understanding of why it exists as described here:
        https://nitter.1d4.us/about

        This also means that if you replace your Twitter node with a Nitter node, you'll likely have a better experience posting to Twitter. (no rate limits of dev account required)

        Conscious tech

        timconsidineT 1 Reply Last reply
        1
        • robiR robi

          @timconsidine Beautiful, nice find on bibliogram.

          I was looking at other such services and Nitter showed up, with a bit more understanding of why it exists as described here:
          https://nitter.1d4.us/about

          This also means that if you replace your Twitter node with a Nitter node, you'll likely have a better experience posting to Twitter. (no rate limits of dev account required)

          timconsidineT Offline
          timconsidineT Offline
          timconsidine
          App Dev
          wrote on last edited by
          #20

          @robi said in Twitter crossposter:

          if you replace your Twitter node with a Nitter node

          oooo, didn't know I could do that !

          I also noticed RSS-Bridge supports an Instagram feed, but haven't played with it yet.

          robiR 1 Reply Last reply
          1
          • timconsidineT timconsidine

            @robi said in Twitter crossposter:

            if you replace your Twitter node with a Nitter node

            oooo, didn't know I could do that !

            I also noticed RSS-Bridge supports an Instagram feed, but haven't played with it yet.

            robiR Offline
            robiR Offline
            robi
            wrote on last edited by
            #21

            @timconsidine I may be wrong as so far it seems as a read-only config, not sure if one can post to Twitter as well.

            Conscious tech

            timconsidineT 1 Reply Last reply
            0
            • robiR robi

              @timconsidine I may be wrong as so far it seems as a read-only config, not sure if one can post to Twitter as well.

              timconsidineT Offline
              timconsidineT Offline
              timconsidine
              App Dev
              wrote on last edited by
              #22

              @robi I don't think you can post via Nitter, it is has no login, just read-only.
              But your post made me think because as you say, the dev accounts have rate limits.
              Limits are not so bad, but they're there, and for some use cases, could be a problem, e.g. analysis and "tweet intelligence".
              My current n8n is great for posting, and I won't hit rate limits.
              But for other use, a lot of tweet fetching might.
              That's where Nitter can come into play.

              robiR 1 Reply Last reply
              3
              • timconsidineT timconsidine

                @robi I don't think you can post via Nitter, it is has no login, just read-only.
                But your post made me think because as you say, the dev accounts have rate limits.
                Limits are not so bad, but they're there, and for some use cases, could be a problem, e.g. analysis and "tweet intelligence".
                My current n8n is great for posting, and I won't hit rate limits.
                But for other use, a lot of tweet fetching might.
                That's where Nitter can come into play.

                robiR Offline
                robiR Offline
                robi
                wrote on last edited by
                #23

                @timconsidine https://github.com/FriendsOfREDAXO/feeds might be good intermediary step so you get nice RSS feeds for N8N.

                Conscious tech

                timconsidineT 1 Reply Last reply
                2
                • robiR robi

                  @timconsidine https://github.com/FriendsOfREDAXO/feeds might be good intermediary step so you get nice RSS feeds for N8N.

                  timconsidineT Offline
                  timconsidineT Offline
                  timconsidine
                  App Dev
                  wrote on last edited by
                  #24

                  @robi 👍

                  1 Reply Last reply
                  1
                  • timconsidineT timconsidine

                    @robi yes, I set the environment variable rather than downgrade.
                    And then it just sailed through.

                    The 1st twitter account is more of an organisation account and the 2nd twitter account is an individual account.
                    I mostly wanted to test that I could auto-RT another account.
                    The Set1 grabs the tweet id returned by Twitter on posting, and the 2nd account RT's that tweet id.
                    Not hugely useful but I wanted to prove it could be done.
                    The Wait is just to provide an 'air gap' of sorts in case it all goes through too quickly for systems to cope.

                    Screenshot 2021-09-26 at 23.08.15.png

                    Images are now added.
                    Docs/forum say HTTP Request node needed for that.

                    And as the RSS feed returns a list of toots, I needed to avoid duplicate posts. So I added an IF node which tests if a toot is older than xxx milliseconds (5 mins in my case), and only continues if it is newer. If none newer, the flow expires (no false tree set up).

                    Now I just need to add a cron or scheduler node.
                    But leaving it manual firing for now to test edge cases which different content might show errors on.

                    rmdesR Offline
                    rmdesR Offline
                    rmdes
                    wrote on last edited by
                    #25

                    @timconsidine Hey, I'm trying to achieve a similar scenario but I'm not getting far, would you by any chance share your n8n workflow ?

                    timconsidineT 2 Replies Last reply
                    0
                    • rmdesR rmdes

                      @timconsidine Hey, I'm trying to achieve a similar scenario but I'm not getting far, would you by any chance share your n8n workflow ?

                      timconsidineT Offline
                      timconsidineT Offline
                      timconsidine
                      App Dev
                      wrote on last edited by
                      #26

                      @rmdes sure, let me copy and upload here in a while

                      1 Reply Last reply
                      0
                      • rmdesR rmdes

                        @timconsidine Hey, I'm trying to achieve a similar scenario but I'm not getting far, would you by any chance share your n8n workflow ?

                        timconsidineT Offline
                        timconsidineT Offline
                        timconsidine
                        App Dev
                        wrote on last edited by
                        #27

                        @rmdes here is my n8n workflow for taking an RSS feed from a mastodon user and posting that to twitter

                        It can sure be made more sophisticated but it works in basic form

                        Main point is that it requires a Twitter OAuth login, which is usually (always?) obtained by having a Twitter API registration which gives you the credentials needed to be input in your n8n.
                        It is not your normal Twitter login.

                        Getting a Twitter API account is not difficult but it's not entirely straight forward. They seem to randomly accept/reject for unclear reasons. But if you have one already or are patient to go through the process, you should be good to go.

                        Cam't seem to attach a file so you may have to copy/paste this into a .json file and then import that into your new n8n workflow.

                        {
                          "name": "mastodon2twitter",
                          "nodes": [
                            {
                              "parameters": {},
                              "name": "Start",
                              "type": "n8n-nodes-base.start",
                              "typeVersion": 1,
                              "position": [
                                -10,
                                30
                              ]
                            },
                            {
                              "parameters": {
                                "url": "https://mastodon.domain/users/username"
                              },
                              "name": "RSS Feed Read",
                              "type": "n8n-nodes-base.rssFeedRead",
                              "typeVersion": 1,
                              "position": [
                                160,
                                30
                              ],
                              "notesInFlow": false,
                              "notes": "account username"
                            },
                            {
                              "parameters": {
                                "values": {
                                  "string": [
                                    {
                                      "name": "tweetString",
                                      "value": "={{$json[\"contentSnippet\"]}}"
                                    }
                                  ]
                                },
                                "options": {}
                              },
                              "name": "Set",
                              "type": "n8n-nodes-base.set",
                              "typeVersion": 1,
                              "position": [
                                320,
                                30
                              ],
                              "notesInFlow": true,
                              "notes": "compose tweetString"
                            },
                            {
                              "parameters": {
                                "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n// Loop over inputs \n\nvar date_run = new Date();\ncnt=0;\nfor (item of items) {\n  var item_date = new Date(item.json.isoDate);\n  if (date_run - item_date > 300000) {\n   //delete items[cnt];\n   item.json.tweetString = \"expired\";\n  } \n cnt++;\n}\n\n//items.length = 1;\n\n// You can write logs to the browser console\n//console.log('Done!');\n\nreturn items;\n\n"
                              },
                              "name": "Function",
                              "type": "n8n-nodes-base.function",
                              "typeVersion": 1,
                              "position": [
                                490,
                                30
                              ],
                              "notesInFlow": true,
                              "notes": "set tweet expired if >5m"
                            },
                            {
                              "parameters": {
                                "conditions": {
                                  "string": [
                                    {
                                      "value1": "={{$json[\"tweetString\"]}}",
                                      "operation": "notEqual",
                                      "value2": "expired"
                                    }
                                  ]
                                },
                                "combineOperation": "any"
                              },
                              "name": "IF",
                              "type": "n8n-nodes-base.if",
                              "typeVersion": 1,
                              "position": [
                                650,
                                40
                              ],
                              "notesInFlow": true,
                              "notes": "check not expired"
                            },
                            {
                              "parameters": {
                                "url": "={{$json[\"enclosure\"][\"url\"]}}",
                                "responseFormat": "file",
                                "options": {}
                              },
                              "name": "HTTP Request",
                              "type": "n8n-nodes-base.httpRequest",
                              "typeVersion": 1,
                              "position": [
                                910,
                                -50
                              ]
                            },
                            {
                              "parameters": {
                                "text": "={{$node[\"Set\"].json[\"tweetString\"]}}",
                                "additionalFields": {
                                  "attachments": "data"
                                }
                              },
                              "name": "Twitter",
                              "type": "n8n-nodes-base.twitter",
                              "typeVersion": 1,
                              "position": [
                                1110,
                                -50
                              ],
                              "notesInFlow": false,
                              "credentials": {
                                "twitterOAuth1Api": "Twitter OAuth account"
                              },
                              "notes": "twitter"
                            },
                            {
                              "parameters": {
                                "triggerTimes": {
                                  "item": [
                                    {
                                      "mode": "everyX",
                                      "value": 5,
                                      "unit": "minutes"
                                    }
                                  ]
                                }
                              },
                              "name": "Cron",
                              "type": "n8n-nodes-base.cron",
                              "typeVersion": 1,
                              "position": [
                                -20,
                                -130
                              ],
                              "notesInFlow": true,
                              "notes": "each 5m"
                            }
                          ],
                          "connections": {
                            "RSS Feed Read": {
                              "main": [
                                [
                                  {
                                    "node": "Set",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            },
                            "Set": {
                              "main": [
                                [
                                  {
                                    "node": "Function",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            },
                            "Function": {
                              "main": [
                                [
                                  {
                                    "node": "IF",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            },
                            "IF": {
                              "main": [
                                [
                                  {
                                    "node": "HTTP Request",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            },
                            "HTTP Request": {
                              "main": [
                                [
                                  {
                                    "node": "Twitter_2",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            },
                            "Cron": {
                              "main": [
                                [
                                  {
                                    "node": "RSS Feed Read",
                                    "type": "main",
                                    "index": 0
                                  }
                                ]
                              ]
                            }
                          },
                          "active": true,
                          "settings": {
                            "saveExecutionProgress": true,
                            "saveManualExecutions": true
                          },
                          "id": 6
                        }
                        
                        

                        218 lines long so be sure to copy all, or send me DM to try to exchange the file

                        rmdesR 2 Replies Last reply
                        3
                        • timconsidineT timconsidine

                          @rmdes here is my n8n workflow for taking an RSS feed from a mastodon user and posting that to twitter

                          It can sure be made more sophisticated but it works in basic form

                          Main point is that it requires a Twitter OAuth login, which is usually (always?) obtained by having a Twitter API registration which gives you the credentials needed to be input in your n8n.
                          It is not your normal Twitter login.

                          Getting a Twitter API account is not difficult but it's not entirely straight forward. They seem to randomly accept/reject for unclear reasons. But if you have one already or are patient to go through the process, you should be good to go.

                          Cam't seem to attach a file so you may have to copy/paste this into a .json file and then import that into your new n8n workflow.

                          {
                            "name": "mastodon2twitter",
                            "nodes": [
                              {
                                "parameters": {},
                                "name": "Start",
                                "type": "n8n-nodes-base.start",
                                "typeVersion": 1,
                                "position": [
                                  -10,
                                  30
                                ]
                              },
                              {
                                "parameters": {
                                  "url": "https://mastodon.domain/users/username"
                                },
                                "name": "RSS Feed Read",
                                "type": "n8n-nodes-base.rssFeedRead",
                                "typeVersion": 1,
                                "position": [
                                  160,
                                  30
                                ],
                                "notesInFlow": false,
                                "notes": "account username"
                              },
                              {
                                "parameters": {
                                  "values": {
                                    "string": [
                                      {
                                        "name": "tweetString",
                                        "value": "={{$json[\"contentSnippet\"]}}"
                                      }
                                    ]
                                  },
                                  "options": {}
                                },
                                "name": "Set",
                                "type": "n8n-nodes-base.set",
                                "typeVersion": 1,
                                "position": [
                                  320,
                                  30
                                ],
                                "notesInFlow": true,
                                "notes": "compose tweetString"
                              },
                              {
                                "parameters": {
                                  "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n// Loop over inputs \n\nvar date_run = new Date();\ncnt=0;\nfor (item of items) {\n  var item_date = new Date(item.json.isoDate);\n  if (date_run - item_date > 300000) {\n   //delete items[cnt];\n   item.json.tweetString = \"expired\";\n  } \n cnt++;\n}\n\n//items.length = 1;\n\n// You can write logs to the browser console\n//console.log('Done!');\n\nreturn items;\n\n"
                                },
                                "name": "Function",
                                "type": "n8n-nodes-base.function",
                                "typeVersion": 1,
                                "position": [
                                  490,
                                  30
                                ],
                                "notesInFlow": true,
                                "notes": "set tweet expired if >5m"
                              },
                              {
                                "parameters": {
                                  "conditions": {
                                    "string": [
                                      {
                                        "value1": "={{$json[\"tweetString\"]}}",
                                        "operation": "notEqual",
                                        "value2": "expired"
                                      }
                                    ]
                                  },
                                  "combineOperation": "any"
                                },
                                "name": "IF",
                                "type": "n8n-nodes-base.if",
                                "typeVersion": 1,
                                "position": [
                                  650,
                                  40
                                ],
                                "notesInFlow": true,
                                "notes": "check not expired"
                              },
                              {
                                "parameters": {
                                  "url": "={{$json[\"enclosure\"][\"url\"]}}",
                                  "responseFormat": "file",
                                  "options": {}
                                },
                                "name": "HTTP Request",
                                "type": "n8n-nodes-base.httpRequest",
                                "typeVersion": 1,
                                "position": [
                                  910,
                                  -50
                                ]
                              },
                              {
                                "parameters": {
                                  "text": "={{$node[\"Set\"].json[\"tweetString\"]}}",
                                  "additionalFields": {
                                    "attachments": "data"
                                  }
                                },
                                "name": "Twitter",
                                "type": "n8n-nodes-base.twitter",
                                "typeVersion": 1,
                                "position": [
                                  1110,
                                  -50
                                ],
                                "notesInFlow": false,
                                "credentials": {
                                  "twitterOAuth1Api": "Twitter OAuth account"
                                },
                                "notes": "twitter"
                              },
                              {
                                "parameters": {
                                  "triggerTimes": {
                                    "item": [
                                      {
                                        "mode": "everyX",
                                        "value": 5,
                                        "unit": "minutes"
                                      }
                                    ]
                                  }
                                },
                                "name": "Cron",
                                "type": "n8n-nodes-base.cron",
                                "typeVersion": 1,
                                "position": [
                                  -20,
                                  -130
                                ],
                                "notesInFlow": true,
                                "notes": "each 5m"
                              }
                            ],
                            "connections": {
                              "RSS Feed Read": {
                                "main": [
                                  [
                                    {
                                      "node": "Set",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              },
                              "Set": {
                                "main": [
                                  [
                                    {
                                      "node": "Function",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              },
                              "Function": {
                                "main": [
                                  [
                                    {
                                      "node": "IF",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              },
                              "IF": {
                                "main": [
                                  [
                                    {
                                      "node": "HTTP Request",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              },
                              "HTTP Request": {
                                "main": [
                                  [
                                    {
                                      "node": "Twitter_2",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              },
                              "Cron": {
                                "main": [
                                  [
                                    {
                                      "node": "RSS Feed Read",
                                      "type": "main",
                                      "index": 0
                                    }
                                  ]
                                ]
                              }
                            },
                            "active": true,
                            "settings": {
                              "saveExecutionProgress": true,
                              "saveManualExecutions": true
                            },
                            "id": 6
                          }
                          
                          

                          218 lines long so be sure to copy all, or send me DM to try to exchange the file

                          rmdesR Offline
                          rmdesR Offline
                          rmdes
                          wrote on last edited by rmdes
                          #28

                          @timconsidine hey there, thanks a lot for the recipe, going to test this out !!

                          • can you explain why the Twitter node is not connected to anything ?
                          • also can you explain what the 5 min function is doing ?

                          I'm asking because even though I have setup everything, (have my own twitter credentials ready and obviously changed the RSS source but I see no posts being created, even though the recipe clearly fetch my RSS feed and at the end of the workflow the twitter node "see" the content of the last theoretical tweet the workflow should have made...but nothing get's out on twitter..

                          f052126f-b9e2-4927-8786-07c5efe7ea6c-image.png

                          No errors on any of the workflow, it all seems to be great, but no output ?!🤔

                          timconsidineT 1 Reply Last reply
                          0
                          • rmdesR rmdes

                            @timconsidine hey there, thanks a lot for the recipe, going to test this out !!

                            • can you explain why the Twitter node is not connected to anything ?
                            • also can you explain what the 5 min function is doing ?

                            I'm asking because even though I have setup everything, (have my own twitter credentials ready and obviously changed the RSS source but I see no posts being created, even though the recipe clearly fetch my RSS feed and at the end of the workflow the twitter node "see" the content of the last theoretical tweet the workflow should have made...but nothing get's out on twitter..

                            f052126f-b9e2-4927-8786-07c5efe7ea6c-image.png

                            No errors on any of the workflow, it all seems to be great, but no output ?!🤔

                            timconsidineT Offline
                            timconsidineT Offline
                            timconsidine
                            App Dev
                            wrote on last edited by
                            #29

                            @rmdes

                            The Twitter node is not connected to anything as output, because it is the end of the process.
                            Are you saying it is not connected on input side when you import the workflow ? But I think it is because our screenshot some incoming values.

                            The 5min function was was simply to filter out posts on Mastodon made >5 mins ago, so that the workflow did not attempt to post "old" posts to Twitter. My understanding is that Twitter would not detect a duplicate tweet (although it does detect duplicate RTs). So the function just takes Mastodon posts from <5 mins age. This is also related to the cron running the workflow every 5 mins.

                            Of course you can adjust these values or remove them, but you might get duplicate tweets.

                            Twitter should give an error if there is a problem, which you can see in the n8n step. Nothing showing there ?

                            rmdesR 2 Replies Last reply
                            0
                            • timconsidineT timconsidine

                              @rmdes

                              The Twitter node is not connected to anything as output, because it is the end of the process.
                              Are you saying it is not connected on input side when you import the workflow ? But I think it is because our screenshot some incoming values.

                              The 5min function was was simply to filter out posts on Mastodon made >5 mins ago, so that the workflow did not attempt to post "old" posts to Twitter. My understanding is that Twitter would not detect a duplicate tweet (although it does detect duplicate RTs). So the function just takes Mastodon posts from <5 mins age. This is also related to the cron running the workflow every 5 mins.

                              Of course you can adjust these values or remove them, but you might get duplicate tweets.

                              Twitter should give an error if there is a problem, which you can see in the n8n step. Nothing showing there ?

                              rmdesR Offline
                              rmdesR Offline
                              rmdes
                              wrote on last edited by
                              #30

                              @timconsidine No no the input is connected just fine, maybe it's just me I had not seen a workflow like this before and it feels weird that nothing goes published..not even sure where to look since I don't have any errors, all executions are success...

                              cce3a5ab-3da7-46d8-b7f3-9d0b239bfe10-image.png

                              robiR timconsidineT 2 Replies Last reply
                              0
                              • timconsidineT timconsidine

                                @rmdes

                                The Twitter node is not connected to anything as output, because it is the end of the process.
                                Are you saying it is not connected on input side when you import the workflow ? But I think it is because our screenshot some incoming values.

                                The 5min function was was simply to filter out posts on Mastodon made >5 mins ago, so that the workflow did not attempt to post "old" posts to Twitter. My understanding is that Twitter would not detect a duplicate tweet (although it does detect duplicate RTs). So the function just takes Mastodon posts from <5 mins age. This is also related to the cron running the workflow every 5 mins.

                                Of course you can adjust these values or remove them, but you might get duplicate tweets.

                                Twitter should give an error if there is a problem, which you can see in the n8n step. Nothing showing there ?

                                rmdesR Offline
                                rmdesR Offline
                                rmdes
                                wrote on last edited by
                                #31

                                @timconsidine by the way, twitter does even more, it detect duplicates tweets also based on content, title + link, if the attempt is made to tweet an item that was already tweeted via the application, the twitter api return an "duplicate tweet" error (that's with my previous python based RSS to twitter experiment) when the duplicate tweet is detected, twitter simply reject the second attempt at tweeting the same thing twice.

                                I think I will have to increase the 5 min because, provided I don't have duplicates I don't mind going back 1h ago to tweet items, I was under the impression that maybe one of the reason it does not tweet the output is maybe because the time span is too short ?

                                1 Reply Last reply
                                0
                                • timconsidineT timconsidine

                                  @rmdes here is my n8n workflow for taking an RSS feed from a mastodon user and posting that to twitter

                                  It can sure be made more sophisticated but it works in basic form

                                  Main point is that it requires a Twitter OAuth login, which is usually (always?) obtained by having a Twitter API registration which gives you the credentials needed to be input in your n8n.
                                  It is not your normal Twitter login.

                                  Getting a Twitter API account is not difficult but it's not entirely straight forward. They seem to randomly accept/reject for unclear reasons. But if you have one already or are patient to go through the process, you should be good to go.

                                  Cam't seem to attach a file so you may have to copy/paste this into a .json file and then import that into your new n8n workflow.

                                  {
                                    "name": "mastodon2twitter",
                                    "nodes": [
                                      {
                                        "parameters": {},
                                        "name": "Start",
                                        "type": "n8n-nodes-base.start",
                                        "typeVersion": 1,
                                        "position": [
                                          -10,
                                          30
                                        ]
                                      },
                                      {
                                        "parameters": {
                                          "url": "https://mastodon.domain/users/username"
                                        },
                                        "name": "RSS Feed Read",
                                        "type": "n8n-nodes-base.rssFeedRead",
                                        "typeVersion": 1,
                                        "position": [
                                          160,
                                          30
                                        ],
                                        "notesInFlow": false,
                                        "notes": "account username"
                                      },
                                      {
                                        "parameters": {
                                          "values": {
                                            "string": [
                                              {
                                                "name": "tweetString",
                                                "value": "={{$json[\"contentSnippet\"]}}"
                                              }
                                            ]
                                          },
                                          "options": {}
                                        },
                                        "name": "Set",
                                        "type": "n8n-nodes-base.set",
                                        "typeVersion": 1,
                                        "position": [
                                          320,
                                          30
                                        ],
                                        "notesInFlow": true,
                                        "notes": "compose tweetString"
                                      },
                                      {
                                        "parameters": {
                                          "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n// Loop over inputs \n\nvar date_run = new Date();\ncnt=0;\nfor (item of items) {\n  var item_date = new Date(item.json.isoDate);\n  if (date_run - item_date > 300000) {\n   //delete items[cnt];\n   item.json.tweetString = \"expired\";\n  } \n cnt++;\n}\n\n//items.length = 1;\n\n// You can write logs to the browser console\n//console.log('Done!');\n\nreturn items;\n\n"
                                        },
                                        "name": "Function",
                                        "type": "n8n-nodes-base.function",
                                        "typeVersion": 1,
                                        "position": [
                                          490,
                                          30
                                        ],
                                        "notesInFlow": true,
                                        "notes": "set tweet expired if >5m"
                                      },
                                      {
                                        "parameters": {
                                          "conditions": {
                                            "string": [
                                              {
                                                "value1": "={{$json[\"tweetString\"]}}",
                                                "operation": "notEqual",
                                                "value2": "expired"
                                              }
                                            ]
                                          },
                                          "combineOperation": "any"
                                        },
                                        "name": "IF",
                                        "type": "n8n-nodes-base.if",
                                        "typeVersion": 1,
                                        "position": [
                                          650,
                                          40
                                        ],
                                        "notesInFlow": true,
                                        "notes": "check not expired"
                                      },
                                      {
                                        "parameters": {
                                          "url": "={{$json[\"enclosure\"][\"url\"]}}",
                                          "responseFormat": "file",
                                          "options": {}
                                        },
                                        "name": "HTTP Request",
                                        "type": "n8n-nodes-base.httpRequest",
                                        "typeVersion": 1,
                                        "position": [
                                          910,
                                          -50
                                        ]
                                      },
                                      {
                                        "parameters": {
                                          "text": "={{$node[\"Set\"].json[\"tweetString\"]}}",
                                          "additionalFields": {
                                            "attachments": "data"
                                          }
                                        },
                                        "name": "Twitter",
                                        "type": "n8n-nodes-base.twitter",
                                        "typeVersion": 1,
                                        "position": [
                                          1110,
                                          -50
                                        ],
                                        "notesInFlow": false,
                                        "credentials": {
                                          "twitterOAuth1Api": "Twitter OAuth account"
                                        },
                                        "notes": "twitter"
                                      },
                                      {
                                        "parameters": {
                                          "triggerTimes": {
                                            "item": [
                                              {
                                                "mode": "everyX",
                                                "value": 5,
                                                "unit": "minutes"
                                              }
                                            ]
                                          }
                                        },
                                        "name": "Cron",
                                        "type": "n8n-nodes-base.cron",
                                        "typeVersion": 1,
                                        "position": [
                                          -20,
                                          -130
                                        ],
                                        "notesInFlow": true,
                                        "notes": "each 5m"
                                      }
                                    ],
                                    "connections": {
                                      "RSS Feed Read": {
                                        "main": [
                                          [
                                            {
                                              "node": "Set",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      },
                                      "Set": {
                                        "main": [
                                          [
                                            {
                                              "node": "Function",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      },
                                      "Function": {
                                        "main": [
                                          [
                                            {
                                              "node": "IF",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      },
                                      "IF": {
                                        "main": [
                                          [
                                            {
                                              "node": "HTTP Request",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      },
                                      "HTTP Request": {
                                        "main": [
                                          [
                                            {
                                              "node": "Twitter_2",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      },
                                      "Cron": {
                                        "main": [
                                          [
                                            {
                                              "node": "RSS Feed Read",
                                              "type": "main",
                                              "index": 0
                                            }
                                          ]
                                        ]
                                      }
                                    },
                                    "active": true,
                                    "settings": {
                                      "saveExecutionProgress": true,
                                      "saveManualExecutions": true
                                    },
                                    "id": 6
                                  }
                                  
                                  

                                  218 lines long so be sure to copy all, or send me DM to try to exchange the file

                                  rmdesR Offline
                                  rmdesR Offline
                                  rmdes
                                  wrote on last edited by rmdes
                                  #32

                                  @timconsidine I increased the time to 1800.000, so 30 minutes, but I don't see any difference, wondering what's happening 🙄
                                  edit : I have 400+ json item that each part of the workflow can fetch, see, but nothing gets out...

                                  1 Reply Last reply
                                  0
                                  • rmdesR rmdes

                                    @timconsidine No no the input is connected just fine, maybe it's just me I had not seen a workflow like this before and it feels weird that nothing goes published..not even sure where to look since I don't have any errors, all executions are success...

                                    cce3a5ab-3da7-46d8-b7f3-9d0b239bfe10-image.png

                                    robiR Offline
                                    robiR Offline
                                    robi
                                    wrote on last edited by
                                    #33

                                    @rmdes Can you just drag a line from your HTTP block to the twitter block?

                                    Conscious tech

                                    1 Reply Last reply
                                    2
                                    • rmdesR rmdes

                                      @timconsidine No no the input is connected just fine, maybe it's just me I had not seen a workflow like this before and it feels weird that nothing goes published..not even sure where to look since I don't have any errors, all executions are success...

                                      cce3a5ab-3da7-46d8-b7f3-9d0b239bfe10-image.png

                                      timconsidineT Offline
                                      timconsidineT Offline
                                      timconsidine
                                      App Dev
                                      wrote on last edited by
                                      #34

                                      @rmdes yes in that diagram there is no input to the Twitter node

                                      Drag from right hand side of HTTP Request node to the left hand side of Twitter node

                                      rmdesR 1 Reply Last reply
                                      1
                                      • timconsidineT timconsidine

                                        @rmdes yes in that diagram there is no input to the Twitter node

                                        Drag from right hand side of HTTP Request node to the left hand side of Twitter node

                                        rmdesR Offline
                                        rmdesR Offline
                                        rmdes
                                        wrote on last edited by rmdes
                                        #35

                                        @timconsidine When I do so I get this error on the HTTP Request node when I execute the workflow :

                                        The "url" argument must be of type string. Received undefined

                                        {
                                        "status": "rejected",
                                        "reason": {
                                        "code": "ERR_INVALID_ARG_TYPE",
                                        "cause": {
                                        "code": "ERR_INVALID_ARG_TYPE"
                                        },
                                        "error": {
                                        "code": "ERR_INVALID_ARG_TYPE"
                                        },
                                        "options": {
                                        }
                                        }
                                        }

                                        Actually I don't understand what this Node is doing, can't I send the data directly to twitter after the IF ?

                                        timconsidineT 1 Reply Last reply
                                        0
                                        • rmdesR rmdes

                                          @timconsidine When I do so I get this error on the HTTP Request node when I execute the workflow :

                                          The "url" argument must be of type string. Received undefined

                                          {
                                          "status": "rejected",
                                          "reason": {
                                          "code": "ERR_INVALID_ARG_TYPE",
                                          "cause": {
                                          "code": "ERR_INVALID_ARG_TYPE"
                                          },
                                          "error": {
                                          "code": "ERR_INVALID_ARG_TYPE"
                                          },
                                          "options": {
                                          }
                                          }
                                          }

                                          Actually I don't understand what this Node is doing, can't I send the data directly to twitter after the IF ?

                                          timconsidineT Offline
                                          timconsidineT Offline
                                          timconsidine
                                          App Dev
                                          wrote on last edited by
                                          #36

                                          @rmdes yes you can send to Twitter node after the IF node providing the tweet is text only. The HTTP node is used to capture any images in the Mastodon tweet and attach them (as binary data I think)

                                          You may just need to "re-map" the HTTP node links from IF node, or re-map the links in the Twitter node to the HTTP output.

                                          I usually step through each node from the start (using that node's run icon, not the whole workflow run icon), and in each subsequent node, check the Input parameters to select the incoming data and map to the node's parameters.

                                          Then I do an end-to-end test.

                                          My workflow provides the general schema, but I had problems on importing other workflows (different use cases). I just deleted each imported node one-by-one and recreated the mode manually, linking to the previous node as explained above.

                                          rmdesR 1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Bookmarks
                                          • Search