2009年5月29日
Blogger API / max_resuts
2009年2月5日
Blogger Data API
PHP による処理
Zend Google Data APIs client library をダウンロードし展開
c:\php\php.ini の include_path に追加
include_path = ".;c:\php\ZendGdata-1.7.3\library"
コマンドラインより実行
C:\php\ZendGdata-1.7.3\demos\Zend\Gdata>c:\php\php Blogger.php -- --user=xxx --pass=xxxx
Note: This sample may Create, Read, Update and Delete data stored in the account provided. Please exit now if you provi
ded an account which contains important data.
0 Tech memo
1 web2000
| public function promptForBlogID() | // 以下の処理で prompt を停止可 |
| { | |
| $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/default/blogs'); | |
| $feed = $this->gdClient->getFeed($query); | |
| $this->printFeed($feed); | |
| //$input = getInput("\nSelection"); | |
| $input = "0"; | //0 Tech memo に固定 |
Selection: 0
Creating a post.
Creating a draft post.
Updating the previous post and publishing it.
The new title of the post is: Hello, world, it is.
The new body of the post is: There we go.
Adding a comment to the previous post.
Added new comment: I am so glad this is public now.
Adding another comment.~
Added new comment: This is a spammy comment.~
Deleting the previous comment.~
Printing all posts.
0 Hello, world, it is.
1 Hello, world!
2 Mambo / Install Maniax2008
3 Joomla! / Install Maniax2008
・・・~
23 multipart/form-data~
24 it's not found as __builtin__.instancemethod
Printing posts between 2007-01-01 and 2007-03-01.
Deleting the post titled: Hello, world, it is.
Blogger.php を元に
Blogger2.php を作成し転送処理を実行
2009年1月30日
Blogger Data API Developer's Guide: PHP Hello, world!
I am on the intarweb!
http://code.google.com/intl/ja/apis/blogger/docs/1.0/developers_guide_php.html
c:\php\php.iniinclude_path = ".;c:\php\ZendGdata-1.7.3\library"
C:\php\ZendGdata-1.7.3\demos\Zend\Gdata>c:\php\php Blogger.php -- --user=xxx --pass=xxxx
Note: This sample may Create, Read, Update and Delete data stored in the account provided. Please exit now if you provi
ded an account which contains important data.
0 Tech memo
1 web2000
Selection: 0
Creating a post.
Creating a draft post.
Updating the previous post and publishing it.
The new title of the post is: Hello, world, it is.
The new body of the post is: There we go.
Adding a comment to the previous post.
Added new comment: I am so glad this is public now.
Adding another comment.
Added new comment: This is a spammy comment.
Deleting the previous comment.
Printing all posts.
0 Hello, world, it is.
1 Hello, world!
2 Mambo / Install Maniax2008
3 Joomla! / Install Maniax2008
・・・
23 multipart/form-data
24 it's not found as __builtin__.instancemethod
Printing posts between 2007-01-01 and 2007-03-01.
Deleting the post titled: Hello, world, it is.
C:\php\ZendGdata-1.7.3\demos\Zend\Gdata>
blogger new posts, setting the scheduled post date and categories
http://groups.google.com/group/bloggerDev/browse_thread/thread/a1eee09632f7eb9e?pli=1
public function createPost($title, $content, $isDraft=False)
{
// We're using the magic factory method to create a Zend_Gdata_Entry.
// http://framework.zend.com/manual/en/zend.gdata.html#zend.gdata.introdduction.magicfactory
$entry = $this->gdClient->newEntry();
$entry->title = $this->gdClient->newTitle(trim($title));
$entry->content = $this->gdClient->newContent(trim($content));
$entry->content->setType('text');
$entry->category = array(
$this->gdClient->newCategory('this is a label', 'http://www.blogger.com/atom/ns#'),
$this->gdClient->newCategory('this is another label', 'http://www.blogger.com/atom/ns#'));
$uri = "http://www.blogger.com/feeds/" . $this->blogID . "/posts/default";
1 日に多数の投稿を行う場合は、確認用の文字の入力を求められます。 確認用の文字は、24 時間が経過すると自動的に削除されます このためのエラー
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Blog has exceeded rate limit or otherwise requires word verification for new posts' in C:\php\ZendGdata-1.7.3\library\Ze nd\Gdata\App.php:644
2008年12月25日
IIS + MySql
2008年12月22日
Force.com Sites Developer
2008年12月18日
SOQL Questions
Q. Does anyone know an easy way to simulate a SELECT DISTINCT operation in SOQL?
Also, how do you check for NULL in a WHERE clause. I know IS NULL does not work?
A. SELECT Id FROM CASE WHERE Id <> null
or
SELECT Id FROM CASE WHERE Id = null
don't think there's anything like distinct though
http://community.salesforce.com/sforce/board/message?board.id=NET_development&message.id=2406&query.id=8066#M2406
Q. Join
Accessing Query Results from a Relationship Query from the Partner WSDL with Axis for Java
http://wiki.apexdevnet.com/index.php/Accessing_Query_Results_from_a_Relationship_Query_from_the_Partner_WSDL_with_Axis_for_Java


Q. Update many rows
sql = "select id from Product2 where ProductCode like '%.jp%' and Family <> 'blog' "
query_result = client.query( sql )
if ( query_result['records'].__len__() < 1 ):
self.response.out.write('no product found with : %s ' % sql )
else :
products = query_result['records']
for product in products:
product['Family'] = 'blog'
results = client.update( product )
self.response.out.write( results )
if results[0]['success'] :
self.response.out.write( 'updated. ' )
else:
self.response.out.write( results[0]['errors'] )
self.response.out.write( 'Error. ' )
2008年12月17日
Cannot build indexes that are in state ERROR.
Uploading index definitions.
Error 400: --- begin server output ---
Cannot build indexes that are in state ERROR.
To vacuum and rebuild your indexes:
1. Create a backup of your index.yaml specification.
2. Determine the indexes in state ERROR from your admin console: http://appengine.google.com/datastore/indexes?&app_id=blog-editor
3. Remove the definitions of the indexes in ERROR from your index.yaml file.
4. Run "appcfg.py vacuum_indexes your_app_dir/"
5. Wait until the ERROR indexes no longer appear in your admin console.
6. Replace the modified version of your index.yaml file with the original.
7. Run "appcfg.py update_indexes your_app_dir/"
--- end server output ---
Your app was updated, but there was an error updating your indexes. Please retry later with appcfg.py update_indexes.
C:\google>appcfg.py vacuum_indexes blog-editor/
Fetching index definitions diff.
This index is no longer defined in your index.yaml file.
ancestor: true
kind: BlogUrlYm
properties: []
Are you sure you want to delete this index? (N/y/a): y
This index is no longer defined in your index.yaml file.
ancestor: true
kind: Blog
properties: []
Are you sure you want to delete this index? (N/y/a): y
This index is no longer defined in your index.yaml file.
ancestor: true
kind: Stock
properties: []
Are you sure you want to delete this index? (N/y/a): y
This index is no longer defined in your index.yaml file.
ancestor: true
kind: Img
properties: []
Are you sure you want to delete this index? (N/y/a): y
This index is no longer defined in your index.yaml file.
kind: Blog
properties:
- direction: desc
name: ym
Are you sure you want to delete this index? (N/y/a): y
This index is no longer defined in your index.yaml file.
ancestor: true
kind: Timeline
properties: []
Are you sure you want to delete this index? (N/y/a): y
Deleting selected index definitions.
C:\google>appcfg.py update_indexes blog-editor/
Uploading index definitions.
SQL and GQL TOP
| is null |
from google.appengine.ext import db r = db.GqlQuery ("SELECT * FROM model WHERE property=:1",None) # None is the python Null. / see |
| count(*) | r.count() |
| like | r = db.GqlQuery("SELECT * FROM model WHERE property >= :1 and property < :2 ", search_key, urllib.unquote(search_key).decode("utf8") + u"\uFFFD" ) |
| update | see |
| != | != # see |
| date | yymm = '2008-05-10 22:22:22' # see ydate = datetime.datetime.strptime(yymm, '%Y-%m-%d %H:%M:%S') |
| 日付検索 |
from datetime import * import datetime d1 = datetime.datetime.strptime('2008-06-01', '%Y-%m-%d') d2 = d1 + timedelta(days=10) r = db.GqlQuery("select * from model where date >=:1 and date <:2 ",d1,d2) for rr in r: print datetime.datetime.strftime(rr,'%Y-%m-%d %H:%M:%S') Dates and Times |
|
datastore viewer http://localhost:8080/_ah/admin/datastore?kind=StockSum&order=-nikkei_max&order_type=float&num=100&start=0 | |
| reference | see (back-references), Many-to-many Join |
| key, key_name ,id | Key names and IDs cannot be used like property values × select * from Greeting where key = "xxxx" × select * from Greeting where id = xxx ○ r = Greeting.get(db.Key.from_path('Greeting', id)) # or key_name ○ r = db.get("agpoZWxsb3dvcmxkcgsLEgRCbG9nGNQBDA") key = r.key() id = r.key().id() |
