GithubHelp home page GithubHelp logo

ludolphus / ti.safari.readinglist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benbahrenburg/ti.safari.readinglist

0.0 2.0 0.0 201 KB

Titanium module to add items to the Safari Reading List

License: Other

Objective-C 34.17% JavaScript 11.09% Python 54.74%

ti.safari.readinglist's Introduction

Ti.Safari.ReadingList

This module provides the ability to add items to the Safari Reading List.

See the module in action in this video.

Before you start

* This is an iOS module only * You need Titanium SDK 3.1.3.GA or greater * You need iOS 7 or greater * Before using this module you first need to install the package. If you need instructions on how to install a 3rd party module please read this installation guide.

Download the compiled release

Download the platform you wish to use:

Building from source?

If you are building from source you will need to do the following:

Import the project into Xcode:

  • Modify the titanium.xcconfig file with the path to your Titanium installation

Setup

  • Download the latest release from the releases folder ( or you can build it yourself )
  • Install the Utterance module. If you need help here is a "How To" guide.
  • You can now use the module via the commonJS require method, example shown below.

Importing the module using require


var readinglist = require('bencoding.reading.list');

Methods

This module provides the following methods to work with the Safari Reading List

isSupported

The isSupported method, will return true if the devices supports the Safari Reading List module or false if this functionality is not available.

Parameters

None

Example


	if(!readinglist.isSupported()){
		alert("Sorry your device doesn't support this functionality");
	}

add

This method continues reading any speech that has been paused.

Parameters

The add method takes a dictionary with the following properties.

url

This required property contains the URL of the item to be added to the Safari Reading List. This can be any valid URL.

title

This required property contains the description Title for the item once added to the Safari Reading List.

previewText

This optional property contains the description text for the item once added to the Safari Reading List.

Return

A dictionary is returned with the following properties.

success

True/False boolean indicator if the item was successfully added to the Safari Reading List.

message

If the method failed, the message property will contain information regarding the reason for failure.

url

The url added to the Safari Reading List

title

The title of the Safari Reading List item added.

previewText

The preview text of the Safari Reading List item added.

Example


	var result = readinglist.add({
		url:"http://bbc.com",
		title:"BBC News",
		previewText:"An Example"
	});

	Ti.API.info(JSON.stringify(result));
	
	if(result.success){
		alert("Successfully added to your reading list");
	}else{
		alert("Something went wrong " + result.message);
	}

Learn More

Examples

Please check the module's example folder or [here](https://github.com/benbahrenburg/Ti.Safari.ReadingList/tree/master/example) for samples on how to use this project.

Twitter

Please consider following the @benCoding Twitter for updates and more about Titanium.

Blog

For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.

License

Utterance is available under the Apache 2.0 license.

Copyright 2013 Benjamin Bahrenburg

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

ti.safari.readinglist's People

Contributors

benbahrenburg avatar ludolphus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.