Auto-Video Site Using Wordpress

Status
Not open for further replies.
I have just done a little testing with this and it works a treat. Took me a couple of minutes to set up, and that was it, worked first time. One thing that I would mention is that if you already have any video that has been posted, the default setting of this plugin seems to make it dissapear from the main page. It can however be seen from the individual page. I guess this is a side effect from having an image substitute the video when the plugin does its stuff. It is easily fixed using the method mentoined earlier, just comment out:

add_action('the_content', 'change_post');

in the ydata.php file and all is back to normal again.

The only thing that I could thing of as an improvement (unless I've missed something here),would be to offer an option to search by videos uploaded 'This week' or 'This month'. That way there would be a bit more churn on the videos that could be chosen from. At the moment it seems to be pulling them from the 'Uploaded Anytime', and sort by 'Relevance', this list can stagnate pretty quickly sometimes.
 


I've just read the comments in automate.php, it looks like you have the sugestion I made above already covered:

'Without this loop we would be limited to 50 videos per keyword, with this loop we are limited to 5,000 videos per keyword, which should be more then enough, if you want more change the 100 in this loop to a larger amount.'
 
This plugin works amazingly well. The scrape is done in seconds, you can setup the videos by category. I for example set up 6 categories and it adds 1-2 videos to each every time. With a cron firing every 1.5 days this seems fairly natural. This is great.

EDIT: if you are scraping popular keywords, make sure you limit the comments. I have some that reach 800+ comment bullshit.
 
Totally agree Glowleaf. If anyone wants to change the colour of the video surround then just alter the code on addvideo.php (line 94 I think) to this:

PHP:
//to give the video a little colour
      $vidcolour1 = "0x5d1719";
      $vidcolour2 = "0xcd311b";
$video_object = '<center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'.$video_id.'&hl=en&fs=1&color1='.$vidcolour1.'&color2='.$vidcolour2.'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$video_id.'&hl=en&fs=1&color1='.$vidcolour1.'&color2='.$vidcolour2.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center><p>'.$desc.'</p>';

You can change the $vidcolour1 and $vidcolour2 to whatever you want. There are some suggestions on Youtube when you click the customize button next to the Embed code.
 
Totally agree Glowleaf. If anyone wants to change the colour of the video surround then just alter the code on addvideo.php (line 94 I think) to this:

PHP:
//to give the video a little colour
      $vidcolour1 = "0x5d1719";
      $vidcolour2 = "0xcd311b";
$video_object = '<center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'.$video_id.'&hl=en&fs=1&color1='.$vidcolour1.'&color2='.$vidcolour2.'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$video_id.'&hl=en&fs=1&color1='.$vidcolour1.'&color2='.$vidcolour2.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center><p>'.$desc.'</p>';
You can change the $vidcolour1 and $vidcolour2 to whatever you want. There are some suggestions on Youtube when you click the customize button next to the Embed code.

Yes you can change that line to change the colors of the player and you can also refer to this page for the other paramaters which YouTube will allow you to change.

YouTube Embedded Player Parameters - YouTube APIs and Tools - Google Code

glowleaf said:
This plugin works amazingly well. The scrape is done in seconds, you can setup the videos by category. I for example set up 6 categories and it adds 1-2 videos to each every time. With a cron firing every 1.5 days this seems fairly natural. This is great.

EDIT: if you are scraping popular keywords, make sure you limit the comments. I have some that reach 800+ comment bullshit.

Yes by default I think the max number of comments is set to like 900, I've never gotten more then that so it can be important to set the max number or ranged comments in the system.

For instance what I like to do is if the site is not that popular yet and people know that then I'll start my comments off between like 5 and 15 for 1 cat and 5 and 30 for another, and a month later I'll raise it to like 15 and 40 for 1 cat and 20 and 50 for another one, and keep going with it.

As for the speed yes it does go pretty quick right now but in time when I clean up the code a bit I will make it go much quicker lol.
 
If you want your sitemaps update automatically do this

oh right 1 more thing and that is about updating your sitemaps automaticallly, you see if your using a sitemap plugin it will not detect that new videos are being added simply because they are skipping the main wordpress flow and being put directly inside the database.

However if you download and use WordPress › Google XML Sitemaps WordPress Plugins install that plugin, go to its settings and read over them you will notice an option which says "Enable manual sitemap building via GET Request" check that option then click on the question mark beside it.

Once you click the question mark it will give you a URL, open up the automate.php file and put this exactly 1 line above the very last } mark.

Code:
@file_get_contents($url);

Replace $url with the URL you got from the plugin, save this file and upload it to your site and create another cron job (I have mine to run once an hour).

When the cron job fires your sitemap will be automatically updated with the new posts created with the Ydata plugin.
 
Thanks for the great plugin.

I have 1 question, where do you run the cron job to automate it?
 
Thanks for the great plugin.

I have 1 question, where do you run the cron job to automate it?

You need to set the cron job up on your hosting providers side of things, contact them if you don't know how and the file you run with the cron is called automate.php
 
Thanks. I found it.

Do I run the addVideo.php for it to automate?

Even though Glowleaf was kind enough to scream the answer at you my answer is.

FUCKING READ.

I mean you only had to briefly look up at post above yours to see the answer to your own question.
 
Sorry I did not make it clear.

What I meant was, do I run the addVideo.php to automate the ydata rather than the automate.php which is for the google sitemap.

Thousand apologies!
 
Sorry I did not make it clear.

What I meant was, do I run the addVideo.php to automate the ydata rather than the automate.php which is for the google sitemap.

Thousand apologies!

You've been answered 3 times now, do some testing if it's not clear ffs. automate.php has nothing to do with google sitemap unless you want to add the line of code to it that updates the sitemap.

It is AUTOMATE.PHP (and the clue is in the filename here) that you need to run (or automate). If you don't understand this then don't post here again untill you have re-read all of the instructions that Aequitas posted above at least 3 times.
 
I'm using this with Wordpress MU (not as a MU plugin, just a regular plugin that needs activation).

I added this to my crontab for each subdomain:

Code:
wget -q hxxp://subdomain.mydomain.tld/wp-content/plugins/ydata/automate.php -O /dev/null
works for the handful of subdomains i have, but there's probably a better way... call a single php file and use CURL to trigger each subdomains automate.php perhaps.
 
I call a perl script from the crontab, cron.pl for example.

Inside cron.pl I put:

Code:
#!/usr/bin/perl
use LWP::Simple;
$doc = get('http://www.glowleaf.net/scriptname.php');
print "Content-type: text/html\n\n";
print $doc;

The code basically makes an HTTP connection to the php file, and it executes it as if a browser requested it.

At the cron.pl, you can append (this word means add at the end of the file) the above code for as many php files as you want to execute at the same time.

Change scriptname.php to the automate.php path. And the domain of course.
Make sure the cron.pl script is in your root folder, sometimes crons mess up. Give the cron.pl chmod 755 permissions.

By appending the above code I wrote above, I currently fire 3 vsplogs at the same time with one cron command.

The command to put in crontab is this for example:

Code:
 30 * * * * /usr/bin/perl /usr/local/cpanel/apache/vhosts/glowleaf.net/httpdocs/cron.pl

Maybe that helps the MOO guys. You can then automate the process by writing the new subdomains upon birth on the cron.pl file.
 
Has anyone received the message "There Are No Other Videos To Be Displayed" when you search using the Manual Control tab? If so, were you able to fix the issue?

I used general short tail search terms (cars, music video) that have hundreds of results when searched for on Youtube itself.
 
I just wanted to thank Aequitas for taking the time to code this plugin and make it available for free to WickedFire members. Great job.

Just a quick question...

I just tried to get the plugin setup and running. Everything went smooth until I tried to do a manual test post and nothing posted to my blog. I went back through Aequitas long description and I am pretty sure that I have everything setup correctly.

The only thing I noticed was that he said the plugin requires PHP5 and I am running a version of PHP4. Could this be what is keeping the plugin from working? Should I upgrade to PHP5?

Thanks for everyones help. You guys are great here.

Andrew
 
Oh yeah, maybe I should have added my host is running PHP 5.2.6 and I'm running WP 2.6. The host also mentioned that they have allow_url_fopen disabled. Is this how the videos are fetched from the API?
Has anyone received the message "There Are No Other Videos To Be Displayed" when you search using the Manual Control tab? If so, were you able to fix the issue?

I used general short tail search terms (cars, music video) that have hundreds of results when searched for on Youtube itself.
 
Last edited:
Status
Not open for further replies.