My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 9 attachment: diff.txt (4.6 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Index: plurk_api.php
===================================================================
--- plurk_api.php (revision 90)
+++ plurk_api.php (working copy)
@@ -214,7 +214,6 @@
*/
function register($nick_name = '', $full_name = '', $password = '', $gender = 'male', $date_of_birth = '0000-00-00', $email = NULL)
{
-
if(strlen($nick_name) < 4)
$this->log('nick name should be longer than 3 characters.');

@@ -293,7 +292,6 @@
}

return $this->is_login;
-
}

/**
@@ -313,7 +311,6 @@
($this->http_status == '200') ? $this->is_login = FALSE : $this->is_login = TRUE;

return !$this->is_login;
-
}

/**
@@ -352,8 +349,7 @@
$this->http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$this->http_response = $result;

- return json_decode($result);
-
+ return json_decode($result);
}

/**
@@ -404,7 +400,6 @@
$this->plurk(PLURK_UPDATE, $array);

return ($this->http_status == '200') ? TRUE : FALSE;
-
}

/**
@@ -496,8 +491,7 @@
* @return array The array (numerical) of plurks (an associative subarray).
* @todo Should rewrite.
*/
- function getPlurks($int_uid = null, $date_from = null, $date_offset = null,
- $fetch_responses = false, $self_plurks_only = false)
+ function getPlurks($int_uid = null, $date_from = null, $date_offset = null, $fetch_responses = false, $self_plurks_only = false)
{
printf("getPlurks: This function is not implemented yet.\n");
}
@@ -563,7 +557,6 @@
$this->plurk(PLURK_TIMELINE_MUTE_PLURKS, $array);

return ($this->http_status == '200') ? TRUE : FALSE;
-
}

/**
@@ -648,18 +641,13 @@
* @param $limited_to Limit the plurk only to some users (also known as private plurking). limited_to should be a Array list of friend ids, e.g. limited_to = array(3,4,66,34) will only be plurked to these user ids.
* @param string $lang The plurk's language.
* @param int $no_commetns If set to 1, then responses are disabled for this plurk. If set to 2, then only friends can respond to this plurk.
- * @return boolean
+ * @return JSON object
* @see /API/Timeline/plurkAdd
*/
function add_plurk($lang = 'en', $qualifier = 'says', $content = 'test from roga-plurk-api', $limited_to = NULL, $no_comments = 0)
{
if( ! $this->is_login) exit(PLURK_NOT_LOGIN);

- if (mb_strlen($content) > 140)
- {
- $this->log('this message should shorter than 140 characters.');
- }
-
$array = array(
'api_key' => $this->api_key,
'qualifier' => $qualifier,
@@ -671,8 +659,13 @@
// roga.2009-12-14: need to confirm.
if (isset($limited_to)) $array['limited_to'] = json_encode($limited_to);

- return $this->plurk(PLURK_TIMELINE_PLURK_ADD, $array);
+ $result = $this->plurk(PLURK_TIMELINE_PLURK_ADD, $array);

+ if ( !isset($result->plurk_id) ) {
+ $this->log($result->error_text);
+ }
+
+ return $result;
}

/**
@@ -764,18 +757,13 @@
*
* @param int $plurk_id The id of the plurk.
* @param string $content The content of plurk.
- * @return boolean
+ * @return JSON object
* @see /API/Timeline/plurkEdit
*/
function edit_plurk($plurk_id = 0, $content = '')
{
if( ! $this->is_login) exit(PLURK_NOT_LOGIN);

- if (mb_strlen($content) > 140)
- {
- $this->log('this message should shorter than 140 characters.');
- }
-
$array = array(
'api_key' => $this->api_key,
'plurk_id' => $plurk_id,
@@ -784,7 +772,11 @@

$result = $this->plurk(PLURK_TIMELINE_PLURK_EDIT, $array);

- return ($this->http_status == '200') ? TRUE : FALSE;
+ if ( !isset($result->plurk_id) ) {
+ $this->log($result->error_text);
+ }
+
+ return $result;
}

/**
@@ -827,18 +819,13 @@
* @param int $plurk_id The plurk that the responses should be added to.
* @param string $content The response's text.
* @param string $qualifier The Plurk's qualifier, please see documents/README
- * @return boolean
+ * @return JSON object
* @see /API/Responses/responseAdd
*/
function add_response($plurk_id = 0, $content = '', $qualifier = 'says')
{
if( ! $this->is_login) exit(PLURK_NOT_LOGIN);

- if (mb_strlen($content) > 140)
- {
- $this->log('this message should shorter than 140 characters.');
- }
-
$array = array(
'api_key' => $this->api_key,
'plurk_id' => $plurk_id,
@@ -848,7 +835,11 @@

$result = $this->plurk(PLURK_ADD_RESPONSE, $array);

- return ($this->http_status == '200') ? TRUE : FALSE;
+ if ( !isset($result->id) ) {
+ $this->log($result->error_text);
+ }
+
+ return $result;
}

/**
Powered by Google Project Hosting