我的客户拥有超过 400,000 名客户的数据库.每个客户都分配了一个 GUID.他希望我选择所有记录,创建一个包含此 GUID 作为参数的动态短 URL".然后将此短网址保存到每个客户记录的字段中.
My client has database of over 400,000 customers. Each customer is assigned a GUID. He wants me to select all the records, create a dynamic "short URL" which includes this GUID as a parameter. Then save this short url to a field on each clients record.
我的第一个问题是,是否有任何网址缩短网站允许您像这样以编程方式即时创建短网址?
The first question I have is do any of the URL shortening sites allow you to programatically create short urls on the fly like this?
推荐答案TinyUrl 允许你这样做(没有被广泛记录),例如:
TinyUrl allow you to do it (not widely documented), for example:
tinyurl/api-create.php?url=www.stackoverflow/
变成tinyurl/6fqmtu
所以你可以有
tinyurl/api-create.php?url=mysite/user/xxxx-xxxx-xxxx-xxxx
到tinyurl/64dva66.
guid 并没有那么清楚,但 URL 应该是唯一的
The guid doesn't end up being that clear, but the URLs should be unique
请注意,您必须通过 HTTPWebRequest 传递它并获得响应.
Note that you'd have to pass this through an HTTPWebRequest and get the response.
更多推荐
为 SQL 数据库动态生成短 URL?
发布评论