Automatically click an menu button in youtube comments page using javascript - javascript

I'm trying to implement a chrome extension to retrieve comments from youtube, a problem is that I want to sort the comments by timeline,one way is to click the "Top Comments" menu and then click the "Newest First" button, I've tried many ways to simulate this operation using javascript(both in content script and chrome console) but failed. Could someone give me some hints? thanks.
Example: see comments of a youtube video here.

If you want to get the comments it's a bad idea to do it using the web interface, instead you should use the API which is less prone to changes.
Useful link:
https://developers.google.com/youtube/2.0/reference#Comments_Feeds
https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#orderbysp
https://developers.google.com/youtube/articles/changes_to_comments

Related

How do I open a link to a website on a new window in a browser and block the current website until the user finish or close the new one?

Currently I'm working with Mercado Pago API, but the thing is that I want when the user clicks the pay button, I want to open a new window in the browser (chrome, firefox, etc.) in the middle of the screen where is going to fill his credit card number and all that stuff meanwhile i want that the background site (I mean the main site where the user clicked on pay) to be blocked, like with darker colors, and not be able to do anything in that site until the user close the new window or he finish with the payment. I've been looking on the internet but I haven't found anything related to the blocked site. Maybe you could help me or have any idea to make that. thanks in advance.
I can't make comments, so sorry in advance for this being an "answer". But are you not able to store information about what the user has selected and then use the current page to process the payment, then bring back or send off what they wanted? perhaps using AJAX to run a PHP page that stores something. Just a suggestion but not entirely an answer, because AFAIK you can't "block" tabs as that could be very dangerous and could be used for the wrong reasons.
The task you want to do requires both back-end programming (php/server-side) and a bit of front-end jquery(js) + ajax.
For front-end something like this could be your start.
Bootstrap Static Modal Example.
And you would need to put your form there, submit it via ajax, and on success close the modal.
I hope this could help you a bit, and get you started in the right direction.
Note: This is not particularly safe. (It's not hard to hide the modal and fiddle around the page in the background.

Simple Facebook "Share Link"

I am working on a site where posts are made and I'd like to give visitors the ability to "share" a particular post that they link on their timeline. I have never done any social media integration, but I followed the instructions via the FB API and am still having problems. It's easier to show you than try to explain it. Go to http://www.badcustomerbureau.com/ and click on any of the Share links at the top of any post. Instead of sharing the post you clicked on, it tries to share a generic post with the same photo every time (photo of a dog). I used the code generator on the FB help site and it still has this issue. Please help!
I did receive one suggestion from a member of this site, but I am still seeing the same behavior.
I think its already working. I've tried it before in my own website http://socialviralworld.com/. You just have to login first and see the changes.
See image:

creating a pop-up(or is it a pop-over?) window for a webpage

I do apologize for the title if it is inaccurate. (feel free to offer me suggestions on the proper wording if needed.)
My question is for my web page, I would like to do something where you click on a link (or image), and instead of opening a new tab or browser window, you get a box that hovers over your page displaying the image of the link (or smaller image you clicked on). I am not sure if the correct term for this is a pop-up or pop-over window.
The best example of what I would like to do, is if you were to go to amazon.com and you see a product and it says "click here for a larger image". when you do that, a sort of window will display itself over the current page and show you the larger image.
Would anyone be able to give an example of code to see how this would be done as well? I am very thankful for any and all recommendations.
You could use a solution like fancybox, I believe this is what are you looking for http://fancybox.net
If I've understood what you mean, there are tons of jquery plugins to do that, for example http://lokeshdhakar.com/projects/lightbox2/
Here is a link, he has an explanation and code snippets for ya, works great.
http://www.htmlgoodies.com/beyond/javascript/article.php/3881276

Pop Up Form With Close Functionality

I realise that to most this is perhaps a very simple query, but I'm relatively new to working with the design elements of an HTML form, so please bear with me.
I'm using this form to allow the user to upload image files.
What I'd like to be able to do, is change the form to a pop window that appears in the centre of the page, but after reading many tutorials, I must admit to being non the wiser. I just wondered whether someone could perhaps please show me what I'd need to do to create this.
I'd also wondered whether it would be possible if someone could perhaps help me out a little please on the 'close form' function. I've added the 'close' functionality to my form, but it appears as a hyperlink, with a 'Warning Message' dialog box appearing upon selection. I'd like, if possible, for this to appear as normal text and without the 'Warning message'.
Any help would truly be appreciated.
Many thanks and Kind regards
I would recommend looking into a jquery lightbox type solution. Using javascript the way you are the warnings and possible blocking of your popup could occur. Here is a simple window.open article that will get your window opened
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
Here is an article to close the window without getting a prompt:
How can I close a browser window without receiving the "Do you want to close this window" prompt?enter link description here
I would recomment JQuery Dialogue. It's easy to implement even for a novice JQuery/Javascript developer

Close button like facebook wall or youtube

I'm a huge newb when it comes to javascript/jQuery/Ajax. I'm looking to learn how to add a close button to content on my site similar to facebook's wall or youtube's experimental homepage.
Where is the starting point to do this? jQuery UI? Any other packaged solutions?
You just need to have a list of links to the function that you want to execute and hide them.
Then, when you click on the close button, it makes that list appear.
Here's a simple example
http://www.jsfiddle.net/9scYR/

Categories

Resources