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
(* based almost entirely on Justin Lancy's script: | |
http://veritrope.com/code/evernote-get-plain-text-of-selected-note/ | |
*) | |
tell application "Evernote" | |
set theSelection to selection | |
set theHTML to HTML content of (item 1 of theSelection) | |
set plainText to ¬ | |
do shell script "echo " & quoted form of theHTML & space & "| textutil -convert txt -stdin -stdout" | |
set myWords to count of words in plainText | |
display dialog "Words: " & myWords with title "Word Count" |
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
def imageExists(url): | |
"""Checks to see if an image URL is actually real and returns a real image""" | |
goodMimes = ['image/png','image/jpg','image/jpeg','image/gif'] | |
try: | |
h = httplib2.Http() | |
r,c = h.request(url,'GET') | |
return r['content-type'] in goodMimes | |
except: | |
return False |
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(){ | |
$('input[placeholder]').each( | |
function(){ | |
var val = $(this).attr('placeholder'); | |
$(this).attr('value',val); | |
} | |
); | |
}); |
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
#import <UIKit/UIKit.h> | |
@interface ECViewController : UIViewController | |
@property (strong, nonatomic) IBOutlet UILabel *usernameField; | |
@property (strong, nonatomic) IBOutlet UILabel *noteCountField; | |
@property (strong, nonatomic) IBOutlet UIButton *noteCountButton; | |
- (IBAction)retrieveUserNameAndNoteCount:(id)sender; |
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
#import "ECViewController.h" | |
@interface ECViewController () | |
@end | |
@implementation ECViewController | |
- (void)viewDidLoad | |
{ |
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
- (int)countAllNotesAndSetTextField:(EvernoteSession *)session | |
{ | |
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore]; | |
[noteStore listNotebooksWithSuccess:^(NSArray *notebooks) { | |
__block int noteCount = 14; | |
for (EDAMNotebook *notebook in notebooks) { | |
if ([notebook guid]) { |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; | |
// Override point for customization after application launch. | |
self.viewController = [[[ECViewController alloc] initWithNibName:@"ECViewController" bundle:nil] autorelease]; | |
self.window.rootViewController = self.viewController; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} |
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
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { | |
// delegate to the Evernote session singleton | |
if ([[EvernoteSession sharedSession] handleOpenURL:url]) { | |
return YES; | |
} | |
return NO; | |
} |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; | |
// Override point for customization after application launch. | |
self.viewController = [[[ECViewController alloc] initWithNibName:@"ECViewController" bundle:nil] autorelease]; | |
self.window.rootViewController = self.viewController; | |
[self.window makeKeyAndVisible]; | |
// Set up Evernote OAuth | |
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
#import "ECAppDelegate.h" | |
#import "ECViewController.h" | |
#import "EvernoteSession.h" |