facebook comments - doesn't let me moderate - javascript

I'm trying to install facebook comments on my page, but it doesn't let me moderate. On a test page with only the comments plugin - no problem. the same code exactly on a live page - doesn't let me moderate.
the test page:
http://www.radicalislam.org/test3.html
the live page:
http://www.radicalislam.org/news/pakistan-hands-huge-prison-sentence-bin-laden-informant
tried to debug, it shows the right admin and app id.
it's a drupal site, if it's important

Looks like you are using partial URLs for the href. Use the full one.
Use the following instead.
<div class="fb-comments" href="http://www.radicalislam.org/news/pakistan-hands-huge-prison-sentence-bin-laden-informant" data-num-posts="5" data-width="580"></div>

Unfortunately my work Firewall wouldn't let me click through to the link.
Are you using the correct URL when you add the Facebook comments to the page? If you aren't you won't be able to moderate, you will likely need to dynamically add the URL to the generated code.

Have you tried scraping the page using the debug tool (as the admin)?
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.radicalislam.org%2Ftest3.html
This will read the updated admin IDs and let the administrator see the moderation panel in the plugin and via https://developers.facebook.com/tools/comments

Related

How to open web app link through gmail add-on?

How to open web app link through gmail add-on?
please help anyone to write a code for in App script
Update
In the current state it's not possible to open a link when I click on my add -on or while opening add on, the homepageTrigger should return:
an array of Card objects that make up the homepage UI
You can open a new FR in Google's Issue Tracker and ask for this feature to be included. Use this template for doing so.
You can easily open a link using newOpenLink()
const openLinkDemo = CardService.newTextButton()
.setText("Click me!")
.setOpenLink(CardService.newOpenLink().setUrl("https://google.com"));
Remember to review the Allowlist URLs guide
Documentation
CardService

Third party script wont load until page refresh

I run into a problem with my blog that I've been writing content for months now. I'm using Gatsby v2 and the Netlify CMS v2 and host the entire blog with the help of Netlify and Github.
I've asked for help a few days ago but the thread got deleted due to not enough clarification.
So, I'm trying again now.
I'm using this starter: https://github.com/thriveweb/yellowcake , and haven't changed much besides CSS yet.
I'm trying to improve my blog by updating the /src/templates/SinglePost.js template for all my blog posts by adding share buttons from Addthis.com. I've successfully added their code (script) to my blog:
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-545927b3c48573a"></script>
by using Netlifys Snippet injection option. This option allows to inject analytics or other scripts into the HTML of the site before </body> tag.
but since its a static website, If I enter the website from the home URL it doesn't load the script on other pages. I have to refresh (reload) the blog post in order to see the share buttons if I'm coming from the homepage or any other page from the website. Is there a way to refresh the blog posts automatically when a user enters the blog post when he's coming from the homepage?
Looking for solutions :)
You can try something like
<body onload="addScript()">
function addScript() {
var my_script = document.createElement('script');
my_script.setAttribute('src','http.....');
document.head.appendChild(my_script);
}

How to scrape the javascript portion of a webpage?

I'm trying to scrape some site in Node.js. I've followed a great tutorial however realize that it might not be what I am looking for, ie. might be looking at scraping the javascript portion of the page instead of the html one.
Is that possible ?
Reason for that is that I am looking for loading the content of the below portion of the code I could find by inspecting in Safari (not showing in Chrome) a kayak.com page (see url below) and seems to be in a scripting section.
reducer: {"reducerPath":"flights\/results\/react\/reducers\/
https://www.kayak.com/flights/TYO-PAR/2019-07-05-flexible/2019-07-14-flexible/1adults/children-11?fs=cfc=1;legdur=-960;stops=~0;bfc=1&sort=bestflight_a&attempt=2&lastms=1550392662619
UPDATE: Unfortunately, this site uses bot/scrape protection: tools like curl get a page with bot warning, headless browser tools like puppeteer get a page with captcha.
===============
As this line is present in the HTML source code and is not added dynamically by JavaScript execution, you can use something like this with the appropriate library API:
const extractedString = [...document.querySelectorAll('script')]
.map(({ textContent }) => textContent)
.find(txt => txt.includes('string'))
.match(/regexp/);

Redirect Users Clicking on a link in your site that goes to an offsite URL

We are changing our social account names/urls. I'll have to go through our websites, emails, etc... and manually change hundred+ number of links. I think our CMS might have the ability to do most of the work on the web, but let's assume it won't for fun.
Since social sites live outside of our domain (facebook, twitter, etc...). I was toying with the idea of replacing the old urls with the new url with jquery or Js. Such as:
$("a[href^='http://OldSocialLink1.com']")
.each(function()
{
this.href = this.href.replace(/^http:\/\/newSocialLink1\.com,
"http://OldSocialLink1.com");
});
Is there a better way to do this-besides changing all the links manually? Possible onclick - If you are on one of our pages and you come across an old social link to facebook and clicked it. Change oldFBLink to new link.
I know of a good search & replace utility available on GitHub here. All you need to do is save it and transfer it to the root directory of your site and navigate to it at 'yoursite.com/migrate.php'
Say if you wanted to change facebook links from 'facebook.com/oldurl' to 'facebook.com/newurl', simply input the new and old URL into the script page. I know this script has been very useful to me while migrating WordPress sites which requires old URLs to be replaced with new ones. Hopefully this script can help you as much as it helped me!

Phonegap+Ember+jQuery+Bootstrap accessing button through jQuery?

I've built an Ember.JS app using the latest Bootstrap.css/js for styling. In one of my templates, I have a button that triggers an action that disables the button and sets it's text to "loading" via the Bootstrap function described here. I access the button using jQuery from within my action as follows:
$('.find').button('loading'); //Starts "Please Wait" message
This worked great when running the ember app a server on my desktop. However, I'm presently trying to package the app into a Phonegapp app, initially in iOS. Whenever the action fires in the simulator, I get the following error:
I'm beginning to suspect this may be due to my action-firing button not being accessible through the class with jQuery like on desktop? But I'm not terribly sure as this is my first Phonegap app. Many thanks if someone can clear this up.
Got it! It was solved by an answer on this question.
I don't think that JQuery is being loaded into the page.
You have referenced it as:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
which says use whatever protocol the current page is being server
from. On a mobile device you are being served from file:// so the
actual request the browser makes to fetch the script is:
file://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
You need to specify the scheme you want to use or else include it in
the PG project itself.
With me, it wasn't my jQuery not being loaded, but rather my Bootstrap.js! When you follow the CDN instructions on the bootstrap website, the URLs are similarly formatted starting with "//" (known as a "protocol-relative URL" or also "network-path reference") instead of the explicit "http://". Making the changed fixed the issue!

Categories