Esempio n. 1
0
// Delete a photo from Flickr
// This method requires authentication with 'delete' permission.
func Delete(client *flickr.FlickrClient, id string) (*flickr.BasicResponse, error) {
	client.Init()
	client.EndpointUrl = flickr.API_ENDPOINT
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photos.delete")
	client.Args.Set("photo_id", id)
	client.OAuthSign()

	response := &flickr.BasicResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}
Esempio n. 2
0
// Delete a photoset
// This method requires authentication with 'write' permission.
func Delete(client *flickr.FlickrClient, photosetId string) (*flickr.BasicResponse, error) {
	client.Init()
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photosets.delete")
	client.Args.Set("photoset_id", photosetId)

	client.OAuthSign()

	response := &flickr.BasicResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}
Esempio n. 3
0
// Set the order of photosets for the calling user.
// Any set IDs not given in the list will be set to appear at the end of the list, ordered by their IDs.
// This method requires authentication with 'write' permission.
func OrderSets(client *flickr.FlickrClient, photosetIds []string) (*flickr.BasicResponse, error) {
	client.Init()
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photosets.orderSets")
	sets := strings.Join(photosetIds, ",")
	client.Args.Set("photoset_ids", sets)

	client.OAuthSign()

	response := &flickr.BasicResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}
Esempio n. 4
0
// Create a photoset specifying its primary photo
// This method requires authentication with 'write' permission.
func Create(client *flickr.FlickrClient, title, description, primaryPhotoId string) (*PhotosetResponse, error) {
	client.Init()
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photosets.create")
	client.Args.Set("title", title)
	client.Args.Set("description", description)
	client.Args.Set("primary_photo_id", primaryPhotoId)

	client.OAuthSign()

	response := &PhotosetResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}
Esempio n. 5
0
// Modify the photos in a photoset. Use this method to add, remove and re-order photos.
// This method requires authentication with 'write' permission.
func EditPhotos(client *flickr.FlickrClient, photosetId, primaryId string, photoIds []string) (*flickr.BasicResponse, error) {
	client.Init()
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photosets.editPhotos")
	client.Args.Set("photoset_id", photosetId)
	client.Args.Set("primary_photo_id", primaryId)
	photos := strings.Join(photoIds, ",")
	client.Args.Set("photo_ids", photos)

	client.OAuthSign()

	response := &flickr.BasicResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}
Esempio n. 6
0
// Edit set name and description
// This method requires authentication with 'write' permission.
func EditMeta(client *flickr.FlickrClient, photosetId, title, description string) (*flickr.BasicResponse, error) {
	client.Init()
	client.HTTPVerb = "POST"
	client.Args.Set("method", "flickr.photosets.editMeta")
	client.Args.Set("photoset_id", photosetId)
	client.Args.Set("title", title)
	if description != "" {
		client.Args.Set("description", description)
	}

	client.OAuthSign()

	response := &flickr.BasicResponse{}
	err := flickr.DoPost(client, response)
	return response, err
}