Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2008, 01:27 PM
Conner85 Conner85 is offline
 
Join Date: Jan 2008
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MySpace Mini in Profile (I know, I know.. I request a lot of MySpace stuff)

I'm looking for someone to create a plugin for the MySpace Mini player to where users can just type in their user name or friend ID and the script "scrapes" their profile for the information, such as the MySpace Mini player. In the Mods forum, there's already a MySpace mp3player plugin that pulls from musician profiles, and I already have that installed, but I tried changing the <object id="mp3player" to <object id="mini" but it didn't work. So that tells me that mp3player and mini use two different types of code. mp3player uses the regular <object and <param tags while the mini is using Javascript. Here is the flash code for the MySpace mini:

Code:
<div id="mini"><embed type="application/x-shockwave-flash" src="http://lads.myspace.com/mini/mini.swf?b=NzY5MjcyMzg=&amp;o=NDI0NjI1MA==&amp;d=MTIwODY5NjEzOA==&amp;i=NTQ0MTE2Njg=&amp;a=VHJ1ZQ==&amp;u=NTQ0MTE2Njg=" id="mini" name="mini" bgcolor="#ffffff" quality="high" allowscriptaccess="always" wmode="transparent" flashvars="e=http%3A//profile.myspace.com/index.cfm%3Ffuseaction%3Duser.viewprofile%26friendid%3D54411668&amp;rollover1=Add song to your profile...&amp;rollover2=Remove song from your profile...&amp;rollover3=View user's song history...&amp;rollover4=View artist's profile...&amp;culture=en-US&amp;skin=defaultskin.swf" height="51" width="295"></div>
The b=NzY .. ect is some kind of encryption for the band's user name and I'm pretty sure the o=NDI0N .. etc is some kind of encryption for the band's song. I'm not sure what the rest is for except for the id, name, bgcolor, friend ID and stuff like that.

Here is the Javascript for it:

Code:
<div id="mini">
Hello, you either have JavaScript turned off or an old version of Macromedia's Flash Player. <a href="http://www.macromedia.com/go/getflashplayer/">Click here</a> to get the latest flash player.

</div>
<script type="text/javascript" language="javascript">
	// <![CDATA[
	var s = "http://lads.myspace.com/mini/mini.swf?b=NzY5MjcyMzg=&o=NDI0NjI1MA==&d=MTIwODY5NjEzOA==&i=NTQ0MTE2Njg=&a=VHJ1ZQ==&u=NTQ0MTE2Njg=";
	var so = new SWFObject( s , "mini", "295", "51", "8", "#ffffff");
	so.addParam("allowscriptaccess", "always");
	so.addVariable("rollover1", "Add song to your profile..."); 
	so.addVariable("rollover2", "Remove song from your profile..."); 
	so.addVariable("rollover3", "View user's song history..."); 
	so.addVariable("rollover4", "View artist's profile...");
    so.addVariable("culture", "en-US");
    so.addParam("wmode", "transparent");
    so.addVariable("skin", "defaultskin.swf");
	so.write("mini");
	// ]]>
</script>
And here is the plugin code for the artist mp3player:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
	<plugin active="1" executionorder="5" product="vbulletin">
		<title>MySpace Player</title>
		<hookname>member_customfields</hookname>
		<phpcode><![CDATA[
			require_once(DIR . '/includes/class_bbcode.php');
			$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
			$url = "http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=".$bbcode_parser->parse($userinfo["field71"],0, true);
			$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
			
			$ch = curl_init();    // initialize curl handle
			curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
			curl_setopt($ch, CURLOPT_FAILONERROR, 1);              // Fail on errors
			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);    // allow redirects
			curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
			curl_setopt($ch, CURLOPT_PORT, 80);            //Set the port number
			curl_setopt($ch, CURLOPT_TIMEOUT, 15); // times out after 15s
			
			curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
			
			$document = curl_exec($ch);
			
			$myplayercode = "";
			if (stripos(html_entity_decode($document),"<object id=\"mp3player\""))
			{
				$start=stripos(html_entity_decode($document),"<object id=\"mp3player\"");	
				$end=stripos(html_entity_decode($document),"</object>");	
				$myplayercode = substr(html_entity_decode($document),$start,$end-$start);
			}
		]]></phpcode>
	</plugin>
</plugins>
If someone could figure out how to get this plugin to pull the mini from a user's MySpace page after they type their MySpace user name into a profile field, that would be awesome.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03686 seconds
  • Memory Usage 2,164KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete