Пример #1
0
func CreateDataStream(context appengine.Context, name string, description string, url string, tagnames []string, pachubeKey string, pachubeFeedId int64, twitterName string, twitterToken string, twitterTokenSecret string) os.Error {

	key_sc, err_sc := (&model.StreamConfiguration{pachubeKey, pachubeFeedId, twitterName, twitterToken, twitterTokenSecret}).Create(context)
	if err_sc != nil {
		return err_sc
	}
	_, tagkeys, err_tags := model.MakeTags(context, tagnames)
	if err_tags != nil {
		return err_tags
	}
	_, key_hu := GetCurrentHowlUser(context)
	_, err_ds := (&model.DataStream{key_hu, name, description, url, nil, nil, key_sc, tagkeys, nil}).Create(context)
	if err_ds != nil {
		return err_ds
	}
	return nil
}
Пример #2
0
/* Get a list of tags, from a list of strings.
 *
 * For each tag, check if the tag is already in the datastore.
 * If it is, return the existing tag, if not create a new one.
 * A list of keys and corresponding model.Tag objects is returned.
 *
 * It is the responsibility of the calling object to ensure that the strings
 * passed to this function have been trimmed.
 */
func PutTags(context appengine.Context, tagnames []string) ([]model.Tag, []*datastore.Key, os.Error) {
	return model.MakeTags(context, tagnames)
}