soundcloudexp

package module
v0.0.0-...-7b40b8c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2015 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-soundcloudexp

An experimental soundcloud api module (for an undocumented api of course!).

Install

You'll need to have golang installed.

$ go get github.com/heatxsink/go-soundcloudexp

Usage


package main

import (
  "fmt"
  "github.com/heatxsink/go-soundcloudexp"
)

func main() {
	user_id := uint64(20804924)
	limit := uint64(10)
	offset := uint64(0)
	response, _ := soundcloudexp.UserReposts(user_id, limit, offset)
	for _, item := range response.Collection {
		if item.Type == "track-repost" {
			oembed, _ := soundcloudexp.OEmbed(item.Track.Uri)
			fmt.Println(oembed.Html)
		}
	}
}

Documentation

Index

Constants

View Source
const (
	SC_REPOST_URL = "https://api-v2.soundcloud.com/profile/soundcloud:users:%d?limit=%d&offset=%d"
	SC_OEMBED_URL = "http://soundcloud.com/oembed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Type     string `json:"type,omitempty"`
	User     User   `json:"user,omitempty"`
	Track    Track  `json:"track,omitempty"`
	Uuid     string `json:"uuid,omitempty"`
	CreateAt string `json:"created_at,omitempty"`
}

type OEmbedResponse

type OEmbedResponse struct {
	Version      float64 `json:"version,omitempty"`
	Type         string  `json:"type,omitempty"`
	ProviderName string  `json:"provider_name,omitempty"`
	ProviderUrl  string  `json:"provider_url,omitempty"`
	Height       uint64  `json:"height,omitempty"`
	Width        string  `json:"width,omitempty"`
	Title        string  `json:"title,omitempty"`
	Description  string  `json:"description,omitempty"`
	ThumbnailUrl string  `json:"thumbnail_url,omitempty"`
	Html         string  `json:"html,omitempty"`
	AuthorName   string  `json:"author_name,omitempty"`
	AuthorUrl    string  `json:"author_url,omitempty"`
}

func OEmbed

func OEmbed(url string) (OEmbedResponse, error)

func OEmbedWithOptions

func OEmbedWithOptions(stream_url string, color string, format string, maxheight string) (OEmbedResponse, error)

type RepostReponse

type RepostReponse struct {
	Collection []Item `json:"collection,omitempty"`
	NextHref   string `json:"next_href,omitempty"`
}

func UserReposts

func UserReposts(user_id uint64, limit uint64, offset uint64) (RepostReponse, error)

type Track

type Track struct {
	User                User   `json:"user,omitempty"`
	UserId              uint64 `json:"user_id,omitempty"`
	Genre               string `json:"genre,omitempty"`
	TagList             string `json:"tag_list,omitempty"`
	Duration            uint64 `json:"duration,omitempty"`
	Downloadable        bool   `json:"downloadable,omitempty"`
	Streamable          bool   `json:"streamable,omitempty"`
	OriginalContentSize uint64 `json:"original_content_size,omitempty"`
	Commentable         bool   `json:"commentable,omitempty"`
	Sharing             string `json:"sharing,omitempty"`
	Public              bool   `json:"public,omitempty"`
	CreatedAt           string `json:"created_at,omitempty"`
	UpdatedAt           string `json:"updated_at,omitempty"`
	Permalink           string `json:"permalink,omitempty"`
	PermalinkUrl        string `json:"permalink_url,omitempty"`
	Kind                string `json:"kind,omitempty"`
	Id                  uint64 `json:"id,omitempty"`
	ArtworkUrl          string `json:"artwork_url,omitempty"`
	Uri                 string `json:"uri,omitempty"`
	StreamUrl           string `json:"stream_url,omitempty"`
	Title               string `json:"title,omitempty"`
	Description         string `json:"description,omitempty"`
}

type User

type User struct {
	FullName             string `json:"full_name,omitempty"`
	Country              string `json:"country,omitempty"`
	City                 string `json:"city,omitempty"`
	TrackCount           uint64 `json:"track_count,omitempty"`
	FollowersCount       uint64 `json:"followers_count,omitempty"`
	FollowingsCount      uint64 `json:"followings_count,omitempty"`
	PublicFavoritesCount uint64 `json:"public_favorites_count,omitempty"`
	GroupsCount          uint64 `json:"group_count,omitempty"`
	Description          string `json:"description,omitempty"`
	Plan                 string `json:"plan,omitempty"`
	Id                   uint64 `json:"id,omitempty"`
	Uri                  string `json:"uri,omitempty"`
	Username             string `json:"username,omitempty"`
	Kind                 string `json:"kind,omitempty"`
	Permalink            string `json:"permalink,omitempty"`
	PermalinkUrl         string `json:"permalink_url,omitempty"`
	FirstName            string `json:"first_name,omitempty"`
	AvatarUrl            string `json:"avatar_url,omitempty"`
	LastModified         string `json:"last_modified,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址