Question

A page has a pastebin snippet embedded. I need a way to open tryfsharp.org with this snippet loaded in just by clicking a link at the page. It is possible if snippet is hosted at fssnip.net by using url in the following format "http://www.tryfsharp.org/Create?codeUrl={sourceurl}". When I insert pastebin url as parameter there, then completely wrong character set is loaded, including non-alphabetical characters. For example, here http://pastebin.com/raw.php?i=hprEq4A8 is code "let a = 1", when I open this url http://www.tryfsharp.org/Create?codeUrl=http://pastebin.com/raw.php?i=hprEq4A8 , it should display code "let a = 1", instead it displays something completely wrong. Anyone managed to make this work?

Was it helpful?

Solution

Use F# Snippets instead of Pastebin :-). If you post an F# snippet there, it will add colorization and tooltips (just like those you see in F# in Visual Studio) and you can load the snippet to Try F# too.

For example, this sample snippet has a "tryfsharp.org" link that takes you to Try F# and loads the snippet using the URL: http://www.tryfsharp.org/Create?codeUrl=http://fssnip.net/raw/iF

If you wanted to use Pastebin, then Pastebin needs to have clientaccesspolicy.xml file in the root (which tells Silverlight that accessing that domain is allowed). You can have a look at the file on fssnip.net So, this is not a feature request for Try F#, but for Pastebin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top