search results matching tag: Regular expressions

» channel: learn

go advanced with your query
Search took 0.000 seconds

  • 1
    Videos (0)     Sift Talk (0)     Blogs (0)     Comments (8)   

"Embed code appears to be invalid"... for YouTube? (Geek Talk Post)

Zawash says...

Yes - the problem is the missing "http:" or "https:" - neither Vimeo nor YouTube supplies the protocol in their generated embed HTML. And since those are two of the major sources of submitted content, this is a problem.
When submitting a video with a missing http:, the validation reports that it is ok, but the submitted video does not work.

It should be enough with a simple regular expression to detect and correct the missing protocol, making it much easier for new users to submit videos.
https://xkcd.com/208/

Can the quote option be fixed? (Talks Talk Post)

gwiz665 says...

You would have to make a regular expression that captures the ugly code and converts it to pretty code instead. Otherwise you would have to make a pretty deep change in the way the comments are saved, such that the links are generated on the fly and saved differently, so when you quote you insert something else than the "raw" html code, but instead something like [quote http://talks.videosift.com/talk/Can-the-quote-option-be-fixed?loadcomm=1#comment-1258926] or [quote=1258926] then it would generate it when posted.

Essentially, it's a bit of a hassle.

Duplicates (Sift Talk Post)

dag says...

Comment hidden because you are ignoring dag. (show it anyway)

Hmm, that's not good - nor supposed to happen, we should be blocking embeds that are truly identical. What happens though is that YouTube changes their parameters and it messes up the regular expressions that determine uniqueness. Time for the @lucky760 signal.

Thumbnail image research thread (Sift Talk Post)

lucky760 says...

That's actually a pretty easy one.

Step 1) Given the video's embed code, find the video id:
630563174283

Step 2) Load the HTML at the video's url with the id you found:
http://www.facebook.com/video/video.php?v=630563174283

Step 3) Look for the line with "thumb_url" on it (quotes inclusive):
("thumb_url", "http%3A%2F%2Fvthumb.ak.facebook.com%2Fvthumb-ak-sf2p%2Fv643%2F34%2F70%2F10200882%2Fb10200882_630563174283_670.jpg")

Step 4) Use a regular expression to extract and url decode the value in quotes after "thumb_url":
http://vthumb.ak.facebook.com/vthumb-ak-sf2p/v643/34/70/10200882/b10200882_630563174283_670.jpg

Done!

Region Blocking and Why the Sift is Important (Blog Entry by Fedquip)

VideoSift v3.1 Unveiled (Sift Talk Post)

jonny says...

Props again Lucky for all the caffeine fueled, blurry eyed, late night coding sessions. IIRC, dag had originally said something about a february release for 3.1. Nicely done.

Got some more lucid thoughts on the changes.

The vote box seems fine to me. I see what people mean about it being a smaller target visually and for the cursor, but that should be easy to get used to (like when downvotes were first introduced).

The usability improvements (recent comments, search, quoting, post snipping, channel list, and kill) are all nice improvements. I recommend some sort of regular expression searching or better matching be a top priority in the next release, though.

Instaban I'll reserve judgement on. I am optimistic though.

The 2 day lifetime for the queue is fine. Honestly, my impression of the consensus was 3 days, but I don't really think it's that big a deal. So far, it seems to have improved the situation, but it's way too early to tell.

The requeue invocation, though, seems kind of ludicrous to me. I can requeue every twelve hours but if, as eric says, I'm away for the weekend, I get screwed? What's the rationale there? Why not allow a requeue every 2 or 3 days (or even a week) on any of your previously queued vids? As long as it doesn't increase the number of vids allowed in the queue, what's the difference? It would be far more useful, and would alleviate one of the possible problems with the new promote (see below).

The new default sorting is a good idea, but I don't think it's working properly. Go to the middle of the queue, and you will find lots of posts where they don't belong. Also, the original submitter's initial vote/view is not being counted. And lastly, since no cookies were invalidated on the changeover, it's likely that very few people are actually using it, which will limit its effectiveness.
(As for sorting by views coming up before - it did. I'm pretty sure MINK initially proposed the idea before 3.0. That got mutated into votes-to-views in discussion, the rationale being that the really popular vids would pop out of the queue very quickly and the crap would quickly get pushed to the bottom. I think the problem was that not many people used that sort mechanism, and most posts don't get that many unique views before being published or discarded.)

The new promote invocation is an interesting idea, but may have some serious flaws. Joedirt already pointed out one of the potential problems, i.e., with enough gold-100s around, the promotion box is bound to get crowded. Also, now that it can be used every two days, it will almost certainly offset some of the benefit of reducing the queue lifetime.

I expected a much bigger outcry that you were taking the most popular pair of invocations away from one of the larger groups of users. It's only been a couple days, so I guess you'll just have to see what kind of reaction you get. Replacing them with the ability to post from "unblessed" hosts might appease the masses. I don't understand the rationale though - the latter ability definitely requires more experience. Shouldn't that have been the gold-100 ability?

How many does it take to make a tag cloud tag? (Sift Talk Post)

lucky760 says...

Damn twiddles, you're some kind of a savant. That's exactly what was happening. I had a regular expression replacement with a hyphen in the middle which of course was interpretted as "through" for the chars on either side of it and the range happened to include numbers, so the digits were being blanked out.

For the layman: It's fixed!

Parsing bug with multiple links (Sift Talk Post)

  • 1


Send this Article to a Friend



Separate multiple emails with a comma (,); limit 5 recipients






Your email has been sent successfully!

Manage this Video in Your Playlists

Beggar's Canyon