Release 0.4.1 is now available of the Harvest API PHP Wrapper Library. This release is a Bug Fix for those accounts that have SSL support enabled. When utilizing the 0.4 version of the library you may notice that if you set SSL to true that you will not get any results back from the server, this is because the cURL library is trying to authenticate the SSL certificate and failing. 0.4.1 contains a bug fix were the CURLOPT_SSL_VERIFYPEER option is set to false. This makes it so the certificate is not validated and results are returned successfully.
To stay up-to-date with all the recent changes please visit the main HarvestAPI release page.
Today (March 12th, 2010) I released Version 1.2 of my YahooFinanceAPI PHP Wrapper Library. This version adds constants defining the Stock Options available from Yahoo Finance. A minor change to be sure, but one that can come in handy to those new to Stock Quotes and the available options.
All the constants are defined in the YahooFinance_Options class and are to be utilized when setting the options to be returned and when getting their values out of the returned stock quotes.
Setting the Options
$api->addOption( YahooFinance_Options::SYMBOL );
$api->addOption( YahooFinance_Options::PREVIOUS_CLOSE);
$api->addOption( YahooFinance_Options::OPEN );
$api->addOption( YahooFinance_Options::LAST_TRADE );
Getting the Stock Option value
$quote->get( YahooFinance_Options::SYMBOL );
$quote->get( YahooFinance_Options::PREVIOUS_CLOSE );
$quote->get( YahooFinance_Options::OPEN );
$quote->get( YahooFinance_Options::LAST_TRADE );
To see full sample code as well as staying up-to-date on changes to the library then please visit the PHP Wrapper Library for Yahoo Finance Stock Quotes API page that is maintained with the latest version for download and usage examples.
PHP, sl1d1t1c1ohgv, Stock Quotes, Yahoo Finance, Yahoo Finance API, YahooFinanceAPI
The robots.txt file is a file that you place at the root of your domain to notify web robots what content of your site should be excluded(e.g. what content they should not index or access). However please understand that robots do not need to follow the instructions you place in this file. Therefore do not exclude a url and assume that no robot can access it only well behaving web robots will follow this file.
With that being said the robots.txt file is a properties file were you can specify 2 items the User-Agent (robot this set of instructions are for) and Disallow uris (the website urls that should not be accessed. For example a basic robots.txt file that would exclude all robots would be:
User-agent: *
Disallow: /
If you wanted to exclude only certain folders then you could have multiple Disallow statements.
User-agent: *
Disallow: /images/
Disallow: /downloads/
Disallow: /Uploads/
The last major item to remember is that you can have different instructions for different robots. Lets assume we want to allow the Google bot access to our site but want to limit all other robots to not viewing content then we would have multiple User-agent Disallow blocks.
User-agent: Goog
Disallow:
User-agent: *
Disallow: /images/
Disallow: /downloads/
Disallow: /Uploads/
That is really all there is to it. The main thing to remember is that the robots.txt file is a guideline that you create for behaving bots like google, bing, and yahoo to utilize to know what content on your site to access. However robots and spiders that are parsing sites to look for email address or to spam content will disregard your robots.txt file and may even use it to determine what content to look at.
Resources
robots, robots.txt
When writing applications, libraries, or other source code we often want some control over how it is used by the community. Licenses allow us developers to protect our rights to the source code while defining the terms in which others may utilize it. Two of the most common licenses used in open source software are the MIT License and GPL License. Although similar in that the they both allow users to utilize, modify, and redistribute the code there is one main difference between these licenses. That difference is that the MIT License is permissive and the GPL License has strong copyleft.
Although it may be confusing at first which library you utilize comes down to whether or not you want to allow the use of your code in proprietary software. The MIT License gives this permission under the stipulation that the License is distributed with that software, while the GPL License only grants use and modification by non-proprietary software.
As the copyright holder of the software you may decide you want to Dual License the software with both licenses allowing users to incorporate your source code into their own software under which ever license they want to use. This is also a viable option and is used by such libraries as JQuery.
Resources:
Copyright, Dual Licensing, GPL, GPL License, License, MIT, MIT License
Regular Expressions or regex for short is a pattern that describes a set of strings. In their most general form they are used to define a set without listing out all the possible elements of the set. These expressions provide a flexible means for identifying text of interest including words, special characters, or character patterns. In programming we often use regular expressions to validate data or to manipulate information by use of delimiters.
Special Characters
Regular Expressions utilize the following characters [\^$.|?*+() therefore if you want to match any of these characters you will have to escape them by use of the \ character. For example if you wanted your pattern to match any . in your string you would use the pattern \.
- [
The [ character denotes the start of a Character Class. A Character Class matches a single character out of all the possibilities listed before the close of the Character Class with ]. Full details on a Character Class can be found within the Basic Syntax section.
Example: [abc] => matches the chacters a or b or c
- \
The backslash character is used to escape a special character to surpress their special meaning it is also used in combination with other character to represent tabs (\t), newlines (\n) and other characters.
- ^
The carat denotes to match at the beginning of the string
Example: ^start would match a string that begins with start
- $
The dollar sign denotes to match at the end of the string
Example: $end would match a string that terminates with end
- .
The dot is used to represent any character
Example: a.b would match any element that was of the format a character b e.g. aab, acb, arb, a.b
- |
The pipe character is used to represent the or logical operator
Example: a|b would match a or b
- ?
The question mark is to make the proceeding character optional in the pattern.
Example: ab? would match a or ab
- *
The star character is used to make the proceeding character repeat zero or more times.
Example: ab* would match a, ab, abb, abbb, etc.
- +
The plus character is used to make the proceeding character repeat one or more times.
Example ab+ would match ab, abb, abbb, etc
- ()
The parenthesis characters are used to group operations.
Example a(b|c) would match ab and ac
Character Class
A Character Class matches a single character out of the set of characters listed in the set. To make it easier to understand it acts as grouping of or statements where [abc] is the same as (a|b|c) with the benefit of containing special character to create additional patterns without having to list out the whole set. It is also important to note that any special character listed above that is not in the set -]^/ do not need to be escaped when used inside a Character Class
- -
A hyphen character is used to denote a character range except if it is placed immediately after the opening bracket
Example: [a-z] would match all lowercase letters
- ^
A carat character immediately after the opening bracket is used to negate the Character Class so that it means the opposite.
Example: [^abc] would match all charcters except a, b, and c
- /
The backslash character is used to escape any special characters within the Character Class
Example: [\^\]] would match the characters ^ and ]
- ]
The left bracket character is used to denote the close of a character class
Summary
Utilizing grouping and character classes you can create powerful expressions perform tasks such as data validation and search and replace. To get further information you can review the Regular Expression page on Wikipedia or the site regular-expressions.info
Regex, Regular Expressions