Extracting Twitter Likes with RegExpFindOnURL

Hi!

Niels was kind enough to help me extracting the number of Likes for Instagram posts. The formula is the following:
=RegexpFindOnUrl(A2;"""likes"":{""count"":(\d*)";1)

Which extract the Likes number from the following HTML page:
//https://instagram.com/p/9G6BRmHsgV/

However, I'm still struggling to use the same concept for finding Likes on Twitter posts. The value can be found in the following part of the HTML code:

<li class="js-stat-count js-stat-favorites stat-count" aria-hidden="true">
  <a tabindex=0 role="button"
     data-tweet-stat-count="9" 
     data-compact-localized-count="9"
     class="request-favorited-popup"
     data-activity-popup-title="9 gillanden">

And I want to find the "9" number in the "9 gillanden" segment. The link for the post above is:
//https://twitter.com/Jakobsson1923/status/664707387014688768

Any help would be greatly appreciated!
/Victor

@diskborste

Hej,

You can use this to extract the amount of likes form a tweet:

=Dump(XPathOnUrl("https://twitter.com/Jakobsson1923/status/664707387014688768","//ul[@class='stats']//li[2]/a/strong","")) 

It's not RegExp, but it will work all the same.

Let me know if you need any additional help.

@heyimwill Thank you very much, it works like a charm :slight_smile:

Just out of curiosity, how did you find that Xpath?

When I copy the xpath from the elements page, I get:
//*[@id="page-container"]/div/div[1]/div[1]/div/div/div/div[2]/div[3]/ul/li[2]/a/strong