Search Results

Search found 3 results on 1 pages for 'thewinchester'.

Page 1/1 | 1 

  • Javascript/Greasemonkey: search for something then set result as a value

    - by thewinchester
    Ok, I'm a bit of a n00b when it comes to JS (I'm not the greatest programmer) so please be gentle - specially if my questions been asked already somewhere and I'm too stupid to find the right answer. Self deprecation out of the way, let's get to the question. Problem There is a site me and a large group of friends frequently use which doesn't display all the information we may like to know - in this case an airline bookings site and the class of travel. While the information is buried in the code of the page, it isn't displayed anywhere to the user. Using a Greasemonkey script, I'd like to liberate this piece of information and display it in a suitable format. Here's the psuedocode of what I'm looking to do. Search dom for specified element define variables Find a string of text If found Set result to a variable Write contents to page at a specific location (before a specified div) If not found Do nothing I think I've achieved most of it so far, except for the key bits of: Searching for the string: The page needs to search for the following piece of text in the page HEAD: mileageRequest += "&CLASSES=S,S-S,S-S"; The Content I need to extract and store is between the second equals (=) sign and the last comma ("). The contents of this area can be any letter between A-Z. I'm not fussed about splitting it up into an array so I could use the elements individually at this stage. Writing the result to a location: Taking that found piece of text and writing it to another location. Code so far This is what I've come up so far, with bits missing highlighted. buttons = document.getElementById('buttons'); ''Search goes here var flightClasses = document.createElement("div"); flightClasses.innerHTML = '<div id="flightClasses"> ' + '<h2>Travel classes</h2>' + 'For the above segments, your flight classes are as follows:' + 'write result here' + '</div>'; main.parentNode.insertBefore(flightClasses, buttons); If anyone could help me, or point me in the right direction to finish this off I'd appreciate it.

    Read the article

  • Automating scraping of table data to XML

    - by thewinchester
    Problem I have a YQL query result that I'm trying to get converted and sort into a clean XML file. Background Being the pains that they are, information from the World Cup isn't freely available in an easy to reuse format. So, after a bit of finessing with YQL I have managed to liberate the required table rows which contain the data I'm after. The YQL query can be viewed at: http://query.yahooapis.com/v1/public/yql/ravingbeefsteak/worldcup2010groupliberator?diagnostics=true I'd like to now convert this information into XML, and being an absolute n00b I don't know where to start or what to look for. I'm also needing to do a find and replace on the data to get the URL's working as they should without manual changes, and hopefully an initial sorting of the data. If anyone can point me in the right direction of what I need to be doing to make my needs a reality it would be greatly appreciated.

    Read the article

  • Multiple infowindows - tearing my hair out

    - by thewinchester
    Ok, I'll admit I'm nowhere near the best programmer on the planet - and I'm used to the answer staring me right in the face but not making sense of it. Problem I need to display multiple markers on a map, each with their own infowindow. I have created the individual markers without a problem, but don't know how to create the infowindows for each. Steps so far I am generating a map using the V3 API within an ASP-based website, with markers being created from a set of DB records. The markers are created by looping through a rs and defining a marker() with the relevant variables: var myLatlng = new google.maps.LatLng(lat,long); var marker = new google.maps.Marker({ map: map, position: myLatlng, title: 'locationname', icon: 'http://google-maps-icons.googlecode.com/files/park.png' }); This is creating all the relevant markers in their correct locations. What I need to do now, and am not sure of how to achieve is give each of them their own unique infowindow which I can use to display information and links relevant to that marker. Source <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script language="javascript"> $(document).ready(function() { //Google Maps var myOptions = { zoom: 5, center: new google.maps.LatLng(-26.66, 122.25), mapTypeControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL } } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); <!-- While locations_haslatlong not BOF.EOF --> <% While ((Repeat1__numRows <> 0) AND (NOT locations_haslatlong.EOF)) %> var myLatlng = new google.maps.LatLng(<%=(locations_haslatlong.Fields.Item("llat").Value)%>,<%=(locations_haslatlong.Fields.Item("llong").Value)%>); var marker = new google.maps.Marker({ map: map, position: myLatlng, title: '<%=(locations_haslatlong.Fields.Item("ldescription").Value)%>', icon: 'http://google-maps-icons.googlecode.com/files/park.png', clickable: true, }); <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 locations_haslatlong.MoveNext() Wend %> <!-- End While locations_haslatlong not BOF.EOF --> google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addListener(marker, 'dblclick', function() { map.setZoom(14); }); });

    Read the article

1