# How to monitor Twitter for user posting a new tweet

**URL:** <https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998>\
**Category:** Help and Support\
**Tags:** twitter, social-media\
**Created:** [July 18, 2022, 8:57am UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998 "2022-07-18T08:57:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![neilbontoft](https://forums.distill.io/letter_avatar_proxy/v4/letter/n/ecb155/32.png) [@neilbontoft](https://forums.distill.io/u/neilbontoft)\
**Post date:** [July 18, 2022, 8:57am UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/1 "2022-07-18T08:57:31Z")

</div>

Hi.

Is there a way to track twitter feed without going down the RSS feed method. I have searched the forum but can’t see anything.

Full page doesnt work effectively for twitter as the column the trending section constantly changes. I can’t see a way to just select the stream of tweets in the centre of the page.

It maybe really obvious but im struggling to see it.

Cheers

---

<div class="post-metadata">

**Author:** ![raksha](https://forums.distill.io/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@raksha](https://forums.distill.io/u/raksha)\
**Post date:** [July 20, 2022, 12:38pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/2 "2022-07-20T12:38:39Z")

</div>

Hi @neilbontoft, welcome to the community forum!

There are lots of dynamic contents in the Twitter feed, so automatically selecting them may cease to work after some time. If you want to monitor any account’s latest 5 tweets, then you can use the following config. It will work in the cloud.

```auto
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [
            {
              "type": "css",
              "expr": "img"
            }
          ],
          "includes": [
            {
              "type": "css",
              "expr": "[data-testid=\"tweet\"] [lang] span"
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 10
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}

```

---

<div class="post-metadata">

**Author:** ![neilbontoft](https://forums.distill.io/letter_avatar_proxy/v4/letter/n/ecb155/32.png) [@neilbontoft](https://forums.distill.io/u/neilbontoft)\
**Post date:** [July 21, 2022, 8:29am UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/3 "2022-07-21T08:29:32Z")

</div>

Thanks for this - seems to the trick for what I need.

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 9, 2023, 7:49pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/4 "2023-05-09T19:49:15Z")

</div>

New user trying to monitor when a particular Twitter user posts a new tweet. I’m using the following as my config, and it almost works. The problem is that twitter changes up the “Promotional tweets” on a users page often. So even though a user hasn’t posted anything new, a change is still detected because the Promo tweet text has changed.

Is there a way I can exclude the promo tweets / only include tweets from the user in question?

```auto
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [
            {
              "type": "css",
              "expr": "img"
            }
          ],
          "includes": [
            {
              "type": "css",
              "expr": "[data-testid=\"tweet\"] [lang] span"
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 10
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [May 10, 2023, 1:19pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/5 "2023-05-10T13:19:48Z")

</div>

Thanks for reaching out, Kyle. It should be possible to customize the config to filter out promoted tweets.

I was looking for one but could not stumble on one right now. Will you be able to share html code of a promoted tweet in a timeline? Browser’s inbuilt element inspector can be used to copy it. Let me know if you need any help getting that out. Cheers!

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 10, 2023, 1:29pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/6 "2023-05-10T13:29:06Z")

</div>

Thanks @ajitk,

I’ve attached a screenshot of the html for a promoted tweet. LMK if this is helpful or if another format would be more helpful.

Kyle

 ![image](https://forums.distill.io/uploads/default/original/1X/13ee64c6579c2d3bc4d3f8ccc3afa489de95c846.png)

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [May 10, 2023, 5:40pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/8 "2023-05-10T17:40:31Z")

</div>

Got it, thanks. Can you try the following config? It excluded the promoted tweets using XPath expression:

```json
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [
            {
              "type": "css",
              "expr": "img"
            },
            {
              "type": "xpath",
              "expr": "//*[@data-testid='cellInnerDiv'][contains(text(), 'Promoted')]"
            }
          ],
          "includes": [
            {
              "type": "css",
              "expr": "[data-testid=\"tweet\"] [lang] span"
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 10
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}

```

Let me know if it works. Cheers!

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 10, 2023, 6:00pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/9 "2023-05-10T18:00:17Z")

</div>

@ajitk Thank you, but seems it’s not working quite yet. See below for examples (highlighted in green) of Promoted Tweet text still getting picked up and not excluded (Promoted tweets from GooglePixel and Tesla).

Is there anything else I can provide to help you investigate?

 ![image](https://forums.distill.io/uploads/default/original/1X/86f82308a2d149c0b4cb292a4ffc2803692a09bd.png)

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 10, 2023, 7:18pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/10 "2023-05-10T19:18:54Z")

</div>

Another thought I had, is that the Promoted Tweets never appear in the first 2 tweets it seems. Is there a way to look at only the first two tweets, i.e. “[data-testid="tweet"] [lang] span” for only the first 2?

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 11, 2023, 2:02pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/11 "2023-05-11T14:02:45Z")

</div>

@ajitk any thoughts on whether limiting to top 2 tweets is possible?

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [May 11, 2023, 2:26pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/12 "2023-05-11T14:26:09Z")

</div>

Got to see a page with promoted tweet. So used that to create and test one. Checkout the following config that should be able to filter out the promoted tweets well:

```json
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [
            {
              "type": "css",
              "expr": "img,svg"
            }
          ],
          "includes": [
            {
              "type": "xpath",
              "expr": "//*[@data-testid='cellInnerDiv'][not(.//*[contains(text(), 'Promoted')])]//*[@data-testid='tweetText']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}

```

Can you try this one out?

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 11, 2023, 2:51pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/13 "2023-05-11T14:51:32Z")

</div>

@ajitk Yes it seems to be working! Thanks so much, you’re a real wizard 🙂

---

<div class="post-metadata">

**Author:** ![koreill1](https://forums.distill.io/user_avatar/forums.distill.io/koreill1/32/533_2.png) [@koreill1](https://forums.distill.io/u/koreill1)\
**Post date:** [May 11, 2023, 3:13pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/14 "2023-05-11T15:13:00Z")

</div>

@ajitk One more thing seems to be happening, in that the check seems to be alternating how many tweets it’s checking against. See below where it’s adding/removing the tweet highlighted in green every other check. Is there a way to ensure it’s checking against the full timeline with every check?

 ![image](https://forums.distill.io/uploads/default/original/1X/15fffe42578034be82670acb02468057fd1093ef.png)

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [May 12, 2023, 10:14am UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/15 "2023-05-12T10:14:29Z")

</div>

Are you using the browser extension for checks? Some dynamic sites don’t load completely when opened in a background tab. They wait for the page to become “visible” to render completely.

Can you try using the desktop app instead? It doesn’t suffer from this limitation. Also, increase the delay in the config to a higher number, say 7 or 10. That should ensure that the page got enough time to load completely.

---

<div class="post-metadata">

**Author:** ![legendarysubmit](https://forums.distill.io/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@legendarysubmit](https://forums.distill.io/u/legendarysubmit)\
**Post date:** [January 27, 2024, 11:25pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/16 "2024-01-27T23:25:11Z")

</div>

ajitk, any chance you could help me solve a similar situation, but with the @threads app instead of Twitter?

---

<div class="post-metadata">

**Author:** ![raksha](https://forums.distill.io/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@raksha](https://forums.distill.io/u/raksha)\
**Post date:** [February 12, 2024, 1:03pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/17 "2024-02-12T13:03:25Z")

</div>

@legendarysubmit You can try out the following config for Threads

```auto
{
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text",
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "css",
              "expr": "[data-interactive-id] div:first-child div:first-child> [dir='auto']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "regexp": {
    "expr": "",
    "flags": "gim"
  }
}

```

---

<div class="post-metadata">

**Author:** ![brantfl](https://forums.distill.io/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@brantfl](https://forums.distill.io/u/brantfl)\
**Post date:** [April 11, 2025, 5:41pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/18 "2025-04-11T17:41:26Z")

</div>

EDIT: I “RTFM” here: [Config and Advanced Options](https://distill.io/docs/web-monitor/config-and-advanced-monitor-options/)

Sorry to revive an old post - I’m not a programmer, so I could really use some help.

I’m looking to get notified for every new post on [https://x.com/MSFT365Status](https://x.com/MSFT365Status)

When I try to paste any of the code above, I get various errors, like Error: Unexpected token ‘:’

Would someone provide an example of ALL of text that should be in the Javascript selector?

---

<div class="post-metadata">

**Author:** ![brantfl](https://forums.distill.io/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@brantfl](https://forums.distill.io/u/brantfl)\
**Post date:** [April 22, 2025, 5:58pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/19 "2025-04-22T17:58:51Z")

</div>

@ajitk or @raksha - would you folks be able to add one of the Twitter monitors above on your computers for this Microsoft 365 Twitter page? [Microsoft 365 Status](https://x.com/MSFT365Status)

I’m getting alerts for changes that I am not seeing, so I’m wondering if you can decipher the alerts (you won’t have to wait long) and let me know if the alerts are actually legitimate, or if the JSON could use some tweaking for that page.

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [April 23, 2025, 1:44pm UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/20 "2025-04-23T13:44:03Z")

</div>

@brantfl sure, i will be back to office next week and check it out.

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [April 29, 2025, 8:45am UTC](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998/21 "2025-04-29T08:45:15Z")

</div>

@brantfl the following selector selects the tweet text:

`[role=article] [data-testid=tweetText]`

i also increased the “wait for duration” to 5 seconds to give the page a bit more time to load:

 ![image](https://forums.distill.io/uploads/default/original/2X/6/62fe4930be633478186e436b6ac497f9f5093d4e.png)

here is the monitor’s exported json that i tested:

[export - twitter-x.com.json](https://forums.distill.io/uploads/short-url/2VL5yy4f8RPQyyv2W3ZHMZYUPpx.json) (704 Bytes)

[Next page](https://forums.distill.io/t/how-to-monitor-twitter-for-user-posting-a-new-tweet/998.md?page=2)
