http://wiki.greasespot.net/GM_openInTab -- to open the constructed URL in a new tab https://developer.mozilla.org/en/DOM/document.location -- to get the current URL https://developer.mozilla.org/en/DOM/document.title -- the title of the document http://www.w3schools.com/xpath/, https://developer.mozilla.org/en/XPathResult, https://developer.mozilla.org/en/DOM/document.evaluate -- you'll need to create an XPath to search for <meta> elements in the <head> with the name attribute 'description', and extract their value attributes. (At least, that's the easiest way IMO.) Perhaps something like this:

    var res = document.evaluate("/head/me...@name='description']", document, 
null, XPathResult.|UNORDERED_NODE_SNAPSHOT_TYPE|, null);

Make sure you take into account the possibility of multiple <meta name="description"> tags.

On 2010-04-07 12:27, Faulk28 wrote:
I'm looking for a greasemonkey script that would help me submit links
to a social networking site that my friends and I are developing.

Basically, the script would obtain, the URL, title and description of
the site I am browsing and then pass them to a webserver in a new
FireFox tab as follows:

http://www.example.com/share.php?url=blah&title=thetitle&description=blahblahblah

Would appreciate any help with this.  I'm hoping someone knows an
existing script or could help me write one.  This functionality would
be similar to FireFox extensions like AddThis, DiggBar etc but is for
local use only.
--
cc | pseudonymous |<http://carlclark.mp/>


--
~ I said "NO" to drugs, but they didn't listen. ~ http://tagzilla.mozdev.org v0.066

--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to greasemonkey-us...@googlegroups.com.
To unsubscribe from this group, send email to 
greasemonkey-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to