NOTE: Newest Version is LOCATED HERE.
Everyone knows that MySpace has a terrible reputation for being a closed system and not allowing developers access to any API. As a result, those of us who run our blogs centrally on self-hosted WordPress installs, as well as many other I’m sure, face the tedious task of manually crossposting to MySpace if you maintain a presence there as well.
Some developers have tried to write plug-ins to do the job, but MySpace is constantly trying to thwart the attempts by relentlessly changing their system.
Fed up with it, I decided to write my own such system and base it on a pretty standard, straight-forward mechanism with the hopes that changes on the MySpace side of things wouldn’t have much effect on the functioning of my code.
In truth, it’s not so much an auto crossposter as it is an auto notifier, but that’s by choice, can be changed on the fly and actually has its advantages.
The first advantage is formatting. I’m rather particular with my formatting and getting MySpace to behave exactly as one wants is, as any user knows, a true pain in the arse. It’s senseless to try to truly format on MySpace, so, I’ve opted to make each new auto entered MySpace blog read as follows:
This keeps the format clean, but has a second added advantage: It encourages people to visit my actual WordPress blog, where I want them to be!
A very simple modification would of course post the entire entry, rather than my customized message, but I’ve chosen to go this route with it.
Of course, the entry on the main profile page lists the appropriate title for the blog entry too:
QUICK INSTRUCTIONS
NOTE: As of August 2, 2007, this script is running fine on a WordPress 2.2 install with PHP 4.3.11, CURL 7.10.6 and MySQL 5.0.18. Though it should run fine on any fairly recent install of these apps, I am here disclosing that the author has only tested it personally and thoroughly on the above install. All others are on their own if it doesn’t work.
NEWEST VERSION IS 2.0a – LOCATED ON THE NEW 2.0 PROJECT PAGE
1.) Save the two files locally
Click on the above links, view the source, and copy and paste each into a new file titled “pingmyspace.php” and “pingmyspace-exec.php”, respectively.
2.) Make minor changes so it works for you.
Modify only the clearly labeled variables at the top of pingmyspace.php with your own information and save.
3.) Upload
Upload the files to your server. Place them anywhere you like – preferably in a directory all its own.
4.) Setup the automatic ping
NOTE: Do NOT activate the plug-in on your plugins administration panel. The method of activation is as follows:
In the WordPress Admin panel, select Options > Writing.
In the Update Services box at the bottom of the page, enter the direct URL for the pingmyspace.php file that you just uploaded:
example: http://www.yourdomain.com/yourdirectory/pingmyspace.php
Click Update Options to save.
The next time that you publish to your blog, WordPress will call your pingmyspace.php file automatically and your MySpace blog will be automatically updated!
To test the functionality, you can manually visit the url of your pingmyspace.php file and the last entry that you made will be crossposted to MySpace.
THE CODE
I owe a huge debt to Greg Sidberry over at elsid.net and his MySpace Access Class and by extension Harry Maugan for his MySpace Login with PHP and cURL and Brad Turcotte (brad [at] bradsucks.net) for some initial development. I may clean up my version sometime down the road and stick to the bare bones of the MySpace Login with cURL and a few of my own self-written blog updating functions, but for now I’m using Greg Sidberry’s work and figured that, in the interest of helping others solve the problem, you’d like to see it sooner rather than later.
The code is pretty straight forward. The first step – requesting pingmyspace.php – does the back-end work of logging into the WordPress database and selecting the latest published entry. It does a little bit of necessary formatting and then simply includes the (modified) MySpace Access Class, establishing the MySpace connection, and then updates the blog with the freshly fetched and formatted data. Simple as that.
Hope this is helpful!
##
UPDATE – JUNE 9, 2007 – NEW VERSION 1.1a
At the urging of Greg Sidberry ( elsid.net ), this code has been submitted to WordPress as a plug-in.
Many thanks to Andrew Brenton ( fxetc.com ) for submitting a mod to prevent accidental repeated crossposting to MySpace. His code has been incorporated into the latest release.
NEW FILES
Instructions remain primarily the same (as given above) but the new files for the latest version are here:
or
Please note that you should save the files locally and transfer them to your server with the new filenames (pingmyspace_v1_1a.php and pingmyspace-exec_v1_1a.php), not the old pingmyspace.php and pingmyspace-exec.php.
Note that I am not giving any guarantees that I will continue to update or support this code. Future versions may or may not be released. Code is shared as is. You are always welcome to submit mods and if I continue development, suitable mods will be incorporated and full credit given. Future releases are entirely dependent upon schedule and availability of time.
UPDATE – JUNE 12, 2007 – NEW VERSION 1.2a
Version 1.2a has been uploaded. This really should have been v1.1.1a, but that’s too many decimals for my liking. The changes here are very minor and current users do not need to move to this new version. The only change is the addition of a verbose output option for testing and troubleshooting. This option will be in all future versions and as there are no major functionality changes, current users can wait until the next major revision to upgrade.
UPDATE – JUNE 13, 2007 – NEW VERSION 1.3a
Another minor change, but important for many users. The method of retrieving and constructing the URL for the post has been modified and will now work with any permalink structure. The previous versions would only accommodate the permalink structure that I use (as I wrote it originally to solve my problem) which is in fact a custom structure. As a result, some people were finding that the plug-in would generate incorrect url’s to their posts. The problem is now fixed and will work for everyone.
UPDATE – JUNE 17, 2007 – NEW VERSION 1.4a
NOTE: If you are unwilling to read and follow the install instructions, do not bother downloading this plugin. THE PLUGIN SHOULD NOT BE ACTIVATED ON YOUR PLUGINS ADMINISTRATION PANEL. Users who do not read the instructions continually get errors when they try this, and then come here to complain about it. If you take the time to FOLLOW THE DIRECTIONS you will find that 9 out of 10 users have no problem at all. I’m more than willing to help out with diagnosing problems as long as you’ve kept up your end of the bargain and have actually read and followed the instructions first.
Added the option to easily choose between posting a notification message on your MySpace blog, or the entire blog entry itself.
Users with non-standard table names in their WordPress install now have more support and can easily set new table names to reference.
UPDATE – SEPTEMBER 11, 2007 – NEW VERSION 2.0a
The code and its operation has undergone a HUGE change. The newest – and easiest to use – version is on THE NEW 2.0 PROJECT PAGE.
COMING VERY SOON
-New option to send out a MySpace bulletin announcing a new blog entry with each blog update.
###
[tags]blogging, Crossposting, cURL, MySpace, MySpace Access Class, MySpace crossposting, PHP, ping, pinging, plugin, WordPress, wp[/tags]


I fooled around with the settings and notice that whatever i set my myspace username and pass to it still says that I have allready posted it to my myspace.
Hey Roderick ,
first of all ” this Thing Rocks” . Finaly may quest for an possibility to crosspost has come to an End . Thanks a lot for that cool Script.
Running it succesfully at a WP 2.2.2 and a privat mayspace Profile.
Works great.
As i am playing in a Band i treid to use it on our Band profile but it seems like the posting code in Band profiles seems to be different than in privat Profiles.
(As mentioned earlier here by someone).
It would be a Killer if someone could get it to work with Band Profiles.
So if there a solution out there….please let me know.
Sascha
Pingback: Gair y Gwynt / Wind Words » Blog Archive » WordPress to MySpace Crossposting
Pingback: WordPress to MySpace Crossposting
Hi – same problem as above. Debig looks like this –
* Successfully Connected to Database
* Successfully Selected Database to Use
* Successfully Grabbed WP DB Data
* Successfully Grabbed Xpost Status
* Story Has Already Been Xposted to MySpace. Ending Script…
But nothing on MySpace…Boo Hoo…..This would be a killer if I could get it to work!!
I should add that I had to change wp_posts to wwp_posts but this shouldnt make a difference I hope….also, my wordpress blog is in Russian with a .ru address.
I tried this and it appeared to double post on Myspace. I will try again.
–Thanks
Pingback: MySpace Crossposter v2 Released
The newest update to the MySpace Crossposter project is on the THE NEW 2.0 PROJECT PAGE
The is the latest release, and the new version’s project page.
Amerikanische Firma „ACG Logistics“ sucht nach Mitarbeiter in Europa fuer die Arbeit im Logistikbereich. Interessanter Job mit guter Verdienstmoeglichkeit.
Schicken Sie bitte Ihre Bewerbung an info@acglogistics.biz
Hi there I came across this posting after googling for myspace music. Thanks for the interesting read. I have often thought about too. Thanks for sharing. On Monday I will have time to look into it more.
Notice: Undefined offset: 1 in /pingmyspace-exec_v1_4a.php on line 191
Line 191 has the hash() function, where it grabs a hash value from the myspace blog preview page to verify it’s been previewed before it submits it for good.
Hi everybody,
So, let’s chat! How are you?
——————
Restaurante en Colombia
Pingback: links for 2008-01-02
Pingback: Denis Welsch - Blog Deluxe & Personal Showcase » Blog Archiv » links for 2008-01-24
http://www.Drewryonline.net
Trying to get that plug in to work and followed all instructions. I thought when I have a new blog post on http://www.Drewryonline.net , that it automatically runs that post on over right away to my MySpace blog. I also used localhost with no quotes as instructed, but no haps. The only thing I am guessing is that when i created the MySQL database, I did make up another name for the “Table name” section. Maybe I should take out wp_posts in the wp-admin/options area and input that table name I made when I created the MySQL database for my domain?
When you have the plugin configured properly, yes, you are correct, it will be posted immediately to MySpace.
Yes, you should have the proper table name listed in the configuration. If you’ve changed the name of your table, then you’ll need to let the plugin know.
FYI – Make sure that you’re using the current version of the software, which can be found via the link at the top of this page.
Hi there… thanks for the cool plugin, but unfortunately it won’t work for me. As mentioned in other comments above, the cross poster doesn’t work with myspace’s band profiles :(
I’d love to know if it’s even possible to modify this plugin to make it work with band profiles, and if so, if that’s something you are thinking about doing in the future.
I also think it would be great if users could set up the plugin in to only publish posts within specific categories to their myspace profile, or perhaps be given the choice whether or not to post to myspace on a per post basis…
Anyhoo.. thanks again for sharing. I’ll try to keep an eye on the development.
Pingback: cross-posting from wordpress to different blogs | Muzikistah.com
Pingback: WordPress 2.5 RC 1 Is Out | BlogsFaqs.com
Pingback: Blaine Garrett » Swarling Black Mable » Blog Archive » Hurray for Crossposting
Pingback: Dan Melton's Blog
I can’t get this to work. Don’t quite understand what the DATABASE HOSTNAME is? should it look something like mydbhostname.website.com or mydbhostname_com?
To: Roderick Russell
If I change line 81 and 82 of “pingmyspace-exec.php” to “0″ [Example:
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 0);]
Would it work on web hosts with safe-mode on? (The error that I got when both above were set to “1″ was:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/domain/public_html/pingmyspace/pingmyspace-exec.php on line 81
To: cromermusic
The database should be “localhost” or similar – ask your web host if its’ something else.
P.S. … I tried the above and was redirected to myspace to log on.
P.S.S. when I just changed first line to “0″, I got a blank page afterwards and no crosspost to myspace.
Any help sincerely appreciated! :-)
Pingback: the laughing linden branch » Facebook and Myspace part two
Pingback: Get More Traffic With This MySpace Cross Posting Wordpress Plugin | Make Money Online - Learn the secret to making money online.
Pingback: What Wordpress Plugin’s Do I Use? | Creeva's World 2.0
I get an error every time I post:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /path/wp-content/plugins/myspacecrossposter_v2_0a.php on line 148
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111 in /path/wp-content/plugins/myspacecrossposter_v2_0a.php on line 414
Could not connect:
Hi everyone. My name is Ray, from Utica, NY. I will be visiting Poland soon, and I am hoping to meet my Polish relatives. I also hope some people from here may help me in contacting my relatives before my visit. Thanks and looking forward to meeting some great people on here!
This plug in has worked pefectly for me for months. However, in the last week it’s stopped working all together. Nothing is getting cross-posted and WordPress displays error messages about the Plug-in.
Any recommendations? Did MySpace change something?
Pingback: A Passion For ‘Puters » Blog Archive » 8. Blogs
The Crossposter causes WordPress to error out when publishing using the web interface. It also causes Ma.gnolia’s bookmark autopost to error out with the same error message, and Flock to not publish WordPress blog entries through the publishing interface built into the browser.
To fix a glitch of posts not submitting properly to MySpace, I added the following around line 520.
$content = str_replace(“\r”, “”, $content);
$content = str_replace(“\n\n”, “”, $content);
$content = str_replace(“\n”, “”, $content);
Hope this helps!
The html tags were stripped. It should have the following html tags in the empty quotes:
\r – “”
\n\n – “p tag”
\n – “br tag”
Pingback: Lep's Lair
installed.
trying to use.
here is the error i get, “Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at ‘reading initial communication packet’, system error: 113 in /home/evancour/public_html/wp-content/plugins/myspacecrossposter_v2_0a.php on line 414
Could not connect:”
any clue?
I’m using bluehost.
Pingback: Integrating social media profile facebook twitter and MySpace |
avodart women
Hello Everybody
Just wanted to share my new experience.
If your Windows XP fails to run due to an error corresponding to missing HAL.DLL, invalid Boot.ini or any other important system boot files you can repair this by using the XP installation CD. Just boot from your XP Setup CD and enter the Recovery Console. Then launch “attrib -H -R -S” on the C:\Boot.ini file and delete it. Launch “Bootcfg /Rebuild” and then Fixboot
Cheers,
Carl
Pingback: Tadd Mencer | Powerful WordPress Plugs
Pingback: Wasney’s Blog » Blog Archive » Crossposting Test
You write very well.
Pingback: 25 Most Beneficial Wordpress Blog Plugins | BloggerSavvy
When I post an article this is what error I get
Warning: Cannot modify header information – headers already sent by (output started at /home/mfekbbfk/public_html/badjobgoodjob.com/wp-content/plugins/myspacecrossposter_v2_0a.php:236) in /home/mfekbbfk/public_html/badjobgoodjob.com/wp-includes/pluggable.php on line 770
But them I refresh the page and it is ok. What can be the problem
deal out viagra up-seize off
Hi, I’ve just registered on this forum)) Want to share a cool vodafone commercial, here it is http://www.youtube.com/watch?v=L6Cuq-BueEs Esta these guys know how to make a great ad))
Hi, it’s a job offer. (Sorry if I post it in wrong place)
Cyprus company is seeking a Campaign Executive to assist with fundraising, presentations, various administrative and sales management duties. If you have fundraising and sales experience, plus intermediate computer knowledge, this job is for you! Apply with us today!
All applicants applying for U.S. job openings must be authorized to work in the United States. All applicants applying for European job openings must be authorized to work in European Union.
We are growing advertising and consulting company offering job opportunities ranging from executive and administrative assistants to customer service representatives, receptionists and general support.
NOTICE: we do not provide relocation, this position is online based, we are using progressive online administrative system. You will have to use a special online training program for free.
Requirements and skills:
1. Higher Education/College
2. 1 + Sales/Management (desired but optional)
3. Strong communicative skills
4. Must have MS Office installed (MS Word)
5. Must have citizenship or Work Permit
6. Adult age
Education and Experience:
1. Internet/MS Office/Outlook
2. Sales/Management/Marketing courses (desired)
Hours:
Mon-Fri; 9:30am – 12:30pm
Apply for this job now or contact our online branch support for additional information:
CV to e-mail manager@mygogreens.com
This comment is automaticlly submitted by WpSender2.1 Soft.
$20 per copy. My email is 12515842@qq.com?
This is the exact reason why facebook is blowing out myspace. They allow openness.