当前位置: 首页>>代码示例>>Golang>>正文


Golang Client.DoRawPost方法代码示例

本文整理汇总了Golang中github.com/anaminus/rbxweb.Client.DoRawPost方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.DoRawPost方法的具体用法?Golang Client.DoRawPost怎么用?Golang Client.DoRawPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/anaminus/rbxweb.Client的用法示例。


在下文中一共展示了Client.DoRawPost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Wall

// Wall posts a message to a group wall. The account the client is logged into
// must have a group role that has permission to post to the group's wall.
//
// This function requires the client to be logged in.
func Wall(client *rbxweb.Client, groupID int32, message string) (success bool) {
	page := client.GetURL(`www`, `/My/Groups.aspx`, url.Values{"gid": {client.I32toa(groupID)}})
	err := client.DoRawPost(page, url.Values{
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$GroupWallPane$NewPost":                       {message},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$GroupWallPane$NewPostButton":                 {},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$rbxGroupRoleSetMembersPane$currentRoleSetID": {},
	})
	if err != nil {
		return false
	}
	return true
}
开发者ID:master3395,项目名称:rbxweb,代码行数:16,代码来源:group.go

示例2: TradeRobux

func TradeRobux(client *rbxweb.Client, robux int64, tickets int64, limit bool, split bool) (err error) {
	page := client.GetURL(`www`, `/My/Money.aspx`, nil)
	query := url.Values{
		"__EVENTTARGET":                                                           {"ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$SubmitTradeButton"},
		"__VIEWSTATE":                                                             {},
		"__EVENTVALIDATION":                                                       {},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$HaveCurrencyDropDownList": {"Robux"},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$HaveAmountTextBoxRestyle": {strconv.Itoa(robux)},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$WantCurrencyDropDownList": {"Tickets"},
		"ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$WantAmountTextBox":        {strconv.Itoa(tickets)},
	}
	if limit {
		query.Set("ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$OrderType", "LimitOrderRadioButton")
	} else {
		query.Set("ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$OrderType", "MarketOrderRadioButton")
	}
	if split {
		query.Set("ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$AllowSplitTradesCheckBox", "on")
	} else {
		query.Set("ctl00$ctl00$cphRoblox$cphMyRobloxContent$ctl00$AllowSplitTradesCheckBox", "off")
	}
	err = client.DoRawPost(page, query)
	return
}
开发者ID:master3395,项目名称:rbxweb,代码行数:24,代码来源:currency.go


注:本文中的github.com/anaminus/rbxweb.Client.DoRawPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。