Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load statistics from youtube when links are pasted to channel #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sillyslux
Copy link

#63

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per #63 (comment), we should only respond to explicit triggers, not just to random links.

ecmabot.js Outdated
@@ -18,6 +18,7 @@ var JSBot = function(profile) {
this.factoids = new FactoidServer(path.join(__dirname, "ecmabot-factoids.json"));
this.caniuse_server = new CanIUseServer;
this.executeRegex = /^((?:sm?|v8|js?|b|n|>>?|>>>>|\|)>)([^>].*)+/;
this.youtubeRegex = /https?:\/\/www.youtube.com\/watch\?v=(\w+)/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about youtu.be links

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the best use for an "explicit trigger" would then be a command like !yt to make it go fetch and paste data after somebody else has already pasted a link. Then it would only occur if at least one user is interested.

youtu.be links won't be a problem, but, maybe the googleapi auth key will?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mainly meant the regex :-) you can extract the video ID from both links if needed.

@sillyslux
Copy link
Author

I think it's something like this. But now you might want to have a good look on those regexes and stuff it does there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants