Is there a way to notify whenever tweet list is updated in twitter embedded widget?












1















I am using twitter embed widget on my website. It posts twitter timeline on my page. I want to toast whenever the tweet list gets updated.



<a class="twitter-timeline" data-width="100%" data-height="382" data-theme="light" data-link-color="#2B7BB9" data-chrome="nofooter " href="https://twitter.com/Arushi_Rajput?ref_src=twsrc%5Etfw">Tweets by Arushi_Rajput</a>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>


List gets updated itself through twitter widget so if I post a tweet on my timeline it automatically updates the list after 30 seconds on my page.



I want to toast whenever I receive a new tweet.










share|improve this question























  • What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

    – ElusiveCoder
    Nov 15 '18 at 11:03
















1















I am using twitter embed widget on my website. It posts twitter timeline on my page. I want to toast whenever the tweet list gets updated.



<a class="twitter-timeline" data-width="100%" data-height="382" data-theme="light" data-link-color="#2B7BB9" data-chrome="nofooter " href="https://twitter.com/Arushi_Rajput?ref_src=twsrc%5Etfw">Tweets by Arushi_Rajput</a>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>


List gets updated itself through twitter widget so if I post a tweet on my timeline it automatically updates the list after 30 seconds on my page.



I want to toast whenever I receive a new tweet.










share|improve this question























  • What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

    – ElusiveCoder
    Nov 15 '18 at 11:03














1












1








1








I am using twitter embed widget on my website. It posts twitter timeline on my page. I want to toast whenever the tweet list gets updated.



<a class="twitter-timeline" data-width="100%" data-height="382" data-theme="light" data-link-color="#2B7BB9" data-chrome="nofooter " href="https://twitter.com/Arushi_Rajput?ref_src=twsrc%5Etfw">Tweets by Arushi_Rajput</a>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>


List gets updated itself through twitter widget so if I post a tweet on my timeline it automatically updates the list after 30 seconds on my page.



I want to toast whenever I receive a new tweet.










share|improve this question














I am using twitter embed widget on my website. It posts twitter timeline on my page. I want to toast whenever the tweet list gets updated.



<a class="twitter-timeline" data-width="100%" data-height="382" data-theme="light" data-link-color="#2B7BB9" data-chrome="nofooter " href="https://twitter.com/Arushi_Rajput?ref_src=twsrc%5Etfw">Tweets by Arushi_Rajput</a>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>


List gets updated itself through twitter widget so if I post a tweet on my timeline it automatically updates the list after 30 seconds on my page.



I want to toast whenever I receive a new tweet.







javascript html twitter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 11:01









Arushi RajputArushi Rajput

318




318













  • What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

    – ElusiveCoder
    Nov 15 '18 at 11:03



















  • What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

    – ElusiveCoder
    Nov 15 '18 at 11:03

















What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

– ElusiveCoder
Nov 15 '18 at 11:03





What do you mean by toast? Do you need any alert? Also can you share the url or code that you are talking about?

– ElusiveCoder
Nov 15 '18 at 11:03












2 Answers
2






active

oldest

votes


















1














You can do it using DOM subtree events...Like below,



$('.your-instaposts-container-class').on('DOMSubtreeModified', function(){
alert('New post Added or Your new post html');
});





share|improve this answer


























  • its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

    – Arushi Rajput
    Nov 15 '18 at 11:17











  • Can you share your live url, so that i can properly look into that?

    – ElusiveCoder
    Nov 15 '18 at 11:24











  • codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

    – Arushi Rajput
    Nov 15 '18 at 11:33











  • I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

    – ElusiveCoder
    Nov 15 '18 at 11:50











  • ohk i will prevent first somehow but, alert does not occur afterwards where it is required

    – Arushi Rajput
    Nov 15 '18 at 12:04



















1














 window.onload= function(){
var x = document.getElementById("twitter-widget-0");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName("timeline-TweetList")[0].addEventListener("DOMNodeInserted", function(event) {
alert("New Tweet Received!!");
});
};


It has been some time while I posted this question. This is the code that worked!






share|improve this answer
























  • That is good, but you may describe what you did to improve your answer.

    – YesThatIsMyName
    Feb 1 at 7:41











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317979%2fis-there-a-way-to-notify-whenever-tweet-list-is-updated-in-twitter-embedded-widg%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You can do it using DOM subtree events...Like below,



$('.your-instaposts-container-class').on('DOMSubtreeModified', function(){
alert('New post Added or Your new post html');
});





share|improve this answer


























  • its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

    – Arushi Rajput
    Nov 15 '18 at 11:17











  • Can you share your live url, so that i can properly look into that?

    – ElusiveCoder
    Nov 15 '18 at 11:24











  • codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

    – Arushi Rajput
    Nov 15 '18 at 11:33











  • I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

    – ElusiveCoder
    Nov 15 '18 at 11:50











  • ohk i will prevent first somehow but, alert does not occur afterwards where it is required

    – Arushi Rajput
    Nov 15 '18 at 12:04
















1














You can do it using DOM subtree events...Like below,



$('.your-instaposts-container-class').on('DOMSubtreeModified', function(){
alert('New post Added or Your new post html');
});





share|improve this answer


























  • its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

    – Arushi Rajput
    Nov 15 '18 at 11:17











  • Can you share your live url, so that i can properly look into that?

    – ElusiveCoder
    Nov 15 '18 at 11:24











  • codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

    – Arushi Rajput
    Nov 15 '18 at 11:33











  • I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

    – ElusiveCoder
    Nov 15 '18 at 11:50











  • ohk i will prevent first somehow but, alert does not occur afterwards where it is required

    – Arushi Rajput
    Nov 15 '18 at 12:04














1












1








1







You can do it using DOM subtree events...Like below,



$('.your-instaposts-container-class').on('DOMSubtreeModified', function(){
alert('New post Added or Your new post html');
});





share|improve this answer















You can do it using DOM subtree events...Like below,



$('.your-instaposts-container-class').on('DOMSubtreeModified', function(){
alert('New post Added or Your new post html');
});






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 '18 at 11:24

























answered Nov 15 '18 at 11:07









ElusiveCoderElusiveCoder

1,2541220




1,2541220













  • its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

    – Arushi Rajput
    Nov 15 '18 at 11:17











  • Can you share your live url, so that i can properly look into that?

    – ElusiveCoder
    Nov 15 '18 at 11:24











  • codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

    – Arushi Rajput
    Nov 15 '18 at 11:33











  • I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

    – ElusiveCoder
    Nov 15 '18 at 11:50











  • ohk i will prevent first somehow but, alert does not occur afterwards where it is required

    – Arushi Rajput
    Nov 15 '18 at 12:04



















  • its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

    – Arushi Rajput
    Nov 15 '18 at 11:17











  • Can you share your live url, so that i can properly look into that?

    – ElusiveCoder
    Nov 15 '18 at 11:24











  • codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

    – Arushi Rajput
    Nov 15 '18 at 11:33











  • I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

    – ElusiveCoder
    Nov 15 '18 at 11:50











  • ohk i will prevent first somehow but, alert does not occur afterwards where it is required

    – Arushi Rajput
    Nov 15 '18 at 12:04

















its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

– Arushi Rajput
Nov 15 '18 at 11:17





its not working as expected. Initially when the page loads its shows the alert when it should not and secondly after I posted a tweet on my timeline, the list got updated but not the alert

– Arushi Rajput
Nov 15 '18 at 11:17













Can you share your live url, so that i can properly look into that?

– ElusiveCoder
Nov 15 '18 at 11:24





Can you share your live url, so that i can properly look into that?

– ElusiveCoder
Nov 15 '18 at 11:24













codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

– Arushi Rajput
Nov 15 '18 at 11:33





codepen.io/arushirajput/pen/mQmKqX I have created this pen however I need to tweet for you to test as I am using my own timeline. If you want to tweet and check you can go to publish.twitter.com/# and choose option profile and edit it with your username and generate your embed and tweet and test

– Arushi Rajput
Nov 15 '18 at 11:33













I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

– ElusiveCoder
Nov 15 '18 at 11:50





I think you need to manipulate this domsubtreemodified event as per your requirements, This will surely help you if you use it with setTimeout for preventing first time alert for the added posts.

– ElusiveCoder
Nov 15 '18 at 11:50













ohk i will prevent first somehow but, alert does not occur afterwards where it is required

– Arushi Rajput
Nov 15 '18 at 12:04





ohk i will prevent first somehow but, alert does not occur afterwards where it is required

– Arushi Rajput
Nov 15 '18 at 12:04













1














 window.onload= function(){
var x = document.getElementById("twitter-widget-0");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName("timeline-TweetList")[0].addEventListener("DOMNodeInserted", function(event) {
alert("New Tweet Received!!");
});
};


It has been some time while I posted this question. This is the code that worked!






share|improve this answer
























  • That is good, but you may describe what you did to improve your answer.

    – YesThatIsMyName
    Feb 1 at 7:41
















1














 window.onload= function(){
var x = document.getElementById("twitter-widget-0");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName("timeline-TweetList")[0].addEventListener("DOMNodeInserted", function(event) {
alert("New Tweet Received!!");
});
};


It has been some time while I posted this question. This is the code that worked!






share|improve this answer
























  • That is good, but you may describe what you did to improve your answer.

    – YesThatIsMyName
    Feb 1 at 7:41














1












1








1







 window.onload= function(){
var x = document.getElementById("twitter-widget-0");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName("timeline-TweetList")[0].addEventListener("DOMNodeInserted", function(event) {
alert("New Tweet Received!!");
});
};


It has been some time while I posted this question. This is the code that worked!






share|improve this answer













 window.onload= function(){
var x = document.getElementById("twitter-widget-0");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName("timeline-TweetList")[0].addEventListener("DOMNodeInserted", function(event) {
alert("New Tweet Received!!");
});
};


It has been some time while I posted this question. This is the code that worked!







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 1 at 7:21









Arushi RajputArushi Rajput

318




318













  • That is good, but you may describe what you did to improve your answer.

    – YesThatIsMyName
    Feb 1 at 7:41



















  • That is good, but you may describe what you did to improve your answer.

    – YesThatIsMyName
    Feb 1 at 7:41

















That is good, but you may describe what you did to improve your answer.

– YesThatIsMyName
Feb 1 at 7:41





That is good, but you may describe what you did to improve your answer.

– YesThatIsMyName
Feb 1 at 7:41


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317979%2fis-there-a-way-to-notify-whenever-tweet-list-is-updated-in-twitter-embedded-widg%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma