This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Option 1: Use an index XML file to list file names to be combined. Transform that XML file (root: files) with this XSL. --> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/"> | |
<xml> | |
<xsl:for-each select="files/file"> | |
<xsl:copy-of select="document(.)/xml/*"/> | |
</xsl:for-each> | |
</xml> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See best option below | |
# Option 1: Simple, but breaks with "xml" element | |
# based on an answer posted on stackoverflow by user "Start-Automating" | |
# see http://stackoverflow.com/questions/2972264/merge-multiple-xml-files-into-one-using-powershell-2-0 | |
$files = get-childitem "full path to parent directory" | |
$finalXml = "<xml>" | |
foreach ($file in $files) { | |
[xml]$xml = Get-Content $file.fullname | |
$finalXml += $xml.xml.InnerXml | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define the oai server and base request string | |
$baseurl = "http://digitalrepository.smu.edu/cgi/oai2.cgi/OAI-script?" | |
$payload = "verb=ListRecords&metadataPrefix=oai_dc" | |
# set up the webclient to grab the xml. some servers reject oai-pmh requests with no user-agent specified | |
$wc = New-Object System.Net.WebClient | |
$wc.Encoding = [Text.Encoding]::UTF8 | |
$wc.Headers.add("User-Agent", "PowerShell Script") | |
# set the first request and load the xml into variable. note: this assumes server response is xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do everything inside AJAX call | |
$.ajax({ | |
url: "https://restapi.tcu.edu/labs/labs.jsonp", | |
dataType: "jsonp", | |
jsonp: false, | |
// Custom callback required due to hardcoded server callback variable | |
jsonpCallback: "labsCallback", | |
success: function(data) { | |
newarr = []; | |
// Get data, frame, and push to empty array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>User story collection tool</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Le styles --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function ttest_from_sum(x As Range, y As Range, values As Range) | |
' Set up for dragging over names with lookup | |
' Change this to fit your needs | |
Set temp = values.Find(x.Value, LookIn:=xlValues) | |
avga = CDec(temp.Offset(1, 0).Value) | |
stda = CDec(temp.Offset(2, 0).Value) | |
numa = CDec(temp.Offset(3, 0).Value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..50} | |
do | |
# ea=$(wget -O - --user-agent="botbotbot" "http://specoll.lib.tcu.edu/dtl_publish/$i/index.html" | grep -oh 'href="[0-9]*.html"' | grep -oh [0-9]*) | |
ea=$(cat "/exlibris/dtl/u3_1/dtle/apache/htdocs/dtl_publish/$i/index.html" | grep -oh 'href="[0-9]*.html"' | grep -oh [0-9]*) | |
for jj in $ea | |
do | |
ace="http://specoll.lib.tcu.edu/dtl_publish/$i/$jj.html" | |
if ! grep $ace "/exlibris/dtl/u3_1/dtle/apache/htdocs/sitemap.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
# where the files at | |
my_files = Dir.chdir(ARGV[0]) { Dir.glob("./*").map{|x| File.expand_path(x) } } | |
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| | |
xml.collection(:xmlns => 'http://www.loc.gov/MARC21/slim') { | |
my_files.each do |my_file| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# please install these gems | |
require 'nokogiri' | |
require 'savon' | |
# define wsdl connection | |
client = Savon::Client.new do | |
wsdl.document = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Toggle the comments below to switch between American/rational date parsing | |
require 'american_date' | |
require 'active_support/core_ext' | |
# require 'date' | |
class SimpleDates | |
def self.parse(mystring) | |
mystring = mystring.to_s.downcase.strip | |
# Date._parse likes '/' better than '-', I guess? |
OlderNewer