Log in

View Full Version : Need Help Regarding A Random Video Widget For Blogger



CrazySam
08-21-2008, 02:17 AM
Hi all! I'm looking for a script (or service) that can be added in the blogger HTML/Javascript widget. The script should be able to show random videos on my blog. I want to store the embed codes of many videos (from youtube, dailymotion etc.) in that script, and then as the user refreshes the page, a random video from that list is shown.

Thanks,
Sam.

rangana
08-21-2008, 04:47 AM
See the code from the link below. It might help:
http://www.ahfb2000.com/webmaster_help_desk/showpost.php?p=29556&postcount=2

CrazySam
08-21-2008, 02:54 PM
Oh thank you thank you so much!!!! You're a genious!! This is exactly what I was looking for!!! YIPPEEE!!!!!!!!!

CrazySam
08-31-2008, 11:45 AM
What should I do to make this script as
<script src="http://www.someserver.com/randomvideo.js" type="text/javascript"></script>

Then I can upload this randomvideo.js to that server after adding newer videos without requiring to go to my blog admin.

Also is there any limit for the number of videos I can add? Will the page load slower if I add too many videos??

rangana
09-02-2008, 12:10 AM
What should I do to make this script as
<script src="http://www.someserver.com/randomvideo.js" type="text/javascript"></script>

Then I can upload this randomvideo.js to that server after adding newer videos without requiring to go to my blog admin.

If I take you right, you can save the file as randomvideo.js and place it in the same folder to where your page resides.



Also is there any limit for the number of videos I can add? Will the page load slower if I add too many videos??
There's no limit. And no, the page will not load slower since only one video will be shown every page's reload.

Hope that makes sense.

CrazySam
09-02-2008, 05:31 PM
If I take you right, you can save the file as randomvideo.js and place it in the same folder to where your page resides.

It is not working when I do like that. I made the randomvideo.js and hosted it on googlepages. Then from Blogger, I called
<script src="http://myid.googlepages.com/randomvideo.js" type="text/javascript"></script>

What am I doing wrong?

rangana
09-02-2008, 11:57 PM
Please provde a link instead.

CrazySam
09-03-2008, 03:02 PM
Please provde a link instead.


I'm sorry, I didn't understand what you meant by "providing a link instead."

BLiZZaRD
09-03-2008, 03:06 PM
Put a link to the problem page, there are problems that aren't in the line of code you provided, and may be others, a link to the page will allow us to see it all for ourselves. :D

CrazySam
09-06-2008, 01:37 PM
Okay here is the link to the problem page:

http://samstestblog5.blogspot.com/

Please help me.

Thanks...

mburt
09-06-2008, 02:35 PM
Well if your js file is from this location:

http://samstestblog5.blogspot.com/random.js

That url has to be in the <script> src:

<script type="text/javascript" href="http://samstestblog5.blogspot.com/random.js"></script>

CrazySam
09-06-2008, 05:02 PM
Still not working. After substituting "src" with "href", the videos still do not show up.

BLiZZaRD
09-06-2008, 05:42 PM
I don't know what you are testing on, but I not only get random videos on refresh but I can watch them as well...

CrazySam
09-07-2008, 02:51 AM
You are watching the videos generated when I put the "whole code" in the Blogger widget section. I will delete that code then.

As I said before, I'm trying to get the videos displayed when I put the code in this fashion.
<script src="http://www.someserver.com/randomvideo.js" type="text/javascript"></script>
This code should call the script "randomvideo.js" stored in the server, "someserver" and display the videos.

Please try now.

The link to the problem page is http://samstestblog5.blogspot.com/

BLiZZaRD
09-07-2008, 12:18 PM
When you are using the .js file on the other server you still have the opening and ending JS codes... you need to remove those.

I am not sure that it will completely solve your problem, but it isn't helping.

CrazySam
09-07-2008, 12:52 PM
Yes, that did the job!! Thanks A LOT!!!!!

Now I request rangana and BLiZZaRD to provide me the url address you guys want me to link to, when I acknowledge both of you guys for helping me, in my next blog post.

BLiZZaRD
09-07-2008, 01:47 PM
You can use my project site linked to in my sig, if you must, but it isn't necessary.

Glad it works!

rangana
09-07-2008, 02:31 PM
You can choose either from the links on my sig, the useless ones.

Glad Blizzard's suggestion worked. I haven't get back to this thread as I'm not recieving notifications anymore.

CrazySam
09-07-2008, 04:02 PM
Alright, I will put the link here when I post that blog.

CrazySam
09-10-2008, 08:43 PM
BLiZZaRD, may I know your real name so that I can put it in that post?

CrazySam
09-13-2008, 03:57 AM
Rangana and BLiZZaRD, here is the link to the post. :)
http://samsbloginess.blogspot.com/2008/09/1-year-of-bloginess.html