X hits on this document

6 views

0 shares

0 downloads

0 comments

2 / 2

Samples

Here is a sample PTM link that posts an image to the user’s “About Me” section. Note the use of single quotes in the image tag in the content. Alternatively, they could’ve also used an escaped double quote (e.g. src=\”http://www.photos.com/userimage.jpg\”)

<form id="myspacepostto" method="post" action="http://www.myspace.com/index.cfm?fuseaction=postto" target="_blank"> <input type="hidden" name="t" value="Photos from my summer trip" /> <input type="hidden" name="c" value="<p>Me at the park</p><img src=’http://www.photos.com/userimage.jpg’" /> <input type="hidden" name="u" value="http://www.photos.com/userimage.jpg" /> <input type="hidden" name="l" value=" " /> <a href="#" onclick="document.getElementById('myspacepostto').submit();return false;"> <img src="http://cms.myspacecdn.com/cms/post_myspace_icon.gif" border="0" alt="Post to MySpace!" /> Share on MySpace! </a> </form>

Here is a sample PTM link that posts a simple link back to a news article that will be placed in the user’s “Heroes” section.

<form id="myspacepostto" method="post" action="http://www.myspace.com/index.cfm?fuseaction=postto" target="_blank"> <input type="hidden" name="t" value="An Important News Article Title" /> <input type="hidden" name="c" value="" /> <input type="hidden" name="u" value="http://www.newssite.com/article.php?id=123" /> <input type="hidden" name="l" value="10" /> <a href="#" onclick="document.getElementById('myspacepostto').submit();return false;"> <img src="http://cms.myspacecdn.com/cms/post_myspace_icon.gif" border="0" alt="Post to MySpace!" /> Share on MySpace! </a> </form>

Implementing PTM as a Get Link

Alternatively, PTM can be implemented as a Get-based hyperlink by copying the following code into your page where you want the PTM link to appear.

<script type="text/javascript"> function GetThis(T, C, U, L) {

var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(T)

  • +

    '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L;

window.open(targetUrl); } </script>

<a href="javascript:GetThis('TITLE_GOES_HERE',’CONTENT_GOES_HERE’, 'URL_GOES_HERE', LOCATION_GOES_HERE’)">

< i m g s r c = " h t t p : / / c m s . m y s p a c e c d n . c o m / c m s / p o s t _ m y s p a c e _ i c o n . g i f " b o r d e r = " 0 " a l t = " P o s t t o M y S p a c e ! " Share on MySpace! </a> / >

Once you’ve cut and paste the code, replace the parameter placeholders as you would for the standard implementation.

  • When implemented as a Get-based hyperlink the Title parameter is limited to 60 characters while the Content parameter is limited to 1000 characters.

  • Be sure to leave the surrounding quotes while escaping any single quotes that appear within your post (e.g. <a href="javascript:GetThis('That/’s What She Said!',’’, 'http://test.com', ‘’)">).

Document info
Document views6
Page views6
Page last viewedThu Oct 27 13:15:08 UTC 2016
Pages2
Paragraphs70
Words833

Comments