Revision: 21906
          http://sourceforge.net/p/bibdesk/svn/21906
Author:   hofman
Date:     2018-02-12 22:32:32 +0000 (Mon, 12 Feb 2018)
Log Message:
-----------
Add files for IUCr web parser. Don't add yet as we need a more specific search, 
the site pages contain too many elements

Added Paths:
-----------
    trunk/bibdesk/BDSKIUCrParser.h
    trunk/bibdesk/BDSKIUCrParser.m

Added: trunk/bibdesk/BDSKIUCrParser.h
===================================================================
--- trunk/bibdesk/BDSKIUCrParser.h                              (rev 0)
+++ trunk/bibdesk/BDSKIUCrParser.h      2018-02-12 22:32:32 UTC (rev 21906)
@@ -0,0 +1,44 @@
+//
+//  BDSKIUCrParser.h
+//  BibDesk
+//
+//  Created by Christiaan on 12/02/2018.
+/*
+ This software is Copyright (c) 2018
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "BDSKLinkedBibTeXParser.h"
+
+
+@interface BDSKIUCrParser : BDSKLinkedBibTeXParser
+@end

Added: trunk/bibdesk/BDSKIUCrParser.m
===================================================================
--- trunk/bibdesk/BDSKIUCrParser.m                              (rev 0)
+++ trunk/bibdesk/BDSKIUCrParser.m      2018-02-12 22:32:32 UTC (rev 21906)
@@ -0,0 +1,65 @@
+//
+//  BDSKIUCrParser.m
+//  BibDesk
+//
+//  Created by Christiaan on 12/02/2018.
+/*
+ This software is Copyright (c) 2018
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "BDSKIUCrParser.h"
+#import "NSXMLNode_BDSKExtensions.h"
+
+
+@implementation BDSKIUCrParser
+
++ (NSString *)host { return @"iucr.org"; }
+
++ (NSString *)linkedBibTeXNodeXPath { return @".//a[@title='Download 
citation']"; }
+
++ (NSString *)linkedBibTeXURLStringFromNode:(NSXMLNode *)node {
+    NSMutableString *hrefValue = [[[node stringValueOfAttribute:@"href"] 
mutableCopy] autorelease];
+    NSRange range = [hrefValue rangeOfString:@"biblio_page?"];
+    if (range.location != NSNotFound)
+        [hrefValue insertString:@"biblio?Action=download&saveas=BIBTeX&cnor=" 
atIndex:NSMaxRange(range)];
+    return hrefValue;
+}
+
++ (NSDictionary *)parserInfo {
+    NSString *parserDescription = NSLocalizedString(@"IUCr portal.  Browsing 
and abstracts are free but full text requires a subscription.", @"Description 
for IUCr site");
+    return [BDSKWebParser parserInfoWithName:@"IUCr"
+                                     address:@"http://iucr.org/";
+                                 description:parserDescription
+                                     feature:BDSKParserFeatureSubscription];
+}
+
+@end

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to