Drupal 7 module
This module uses V2 of the weibo API and allows you to choose content types that will autopost to your assigned Weibo Profile page.
From wikipedia:
Sina Weibo is a Chinese microblogging (weibo) website. Akin to a hybrid of Twitter and Facebook, it is one of the most popular sites in China, in use by well over 30% of Internet users.
Current Features;
- Choose Content Types for autopost
- Include Images for post (max 5mb set by API)
- Post will be in the format of 【title】truncated summary (shortened link to node) (max 140chars total)
- latest 20 Weibo post is listed in admin/reports/weibo_mangement.
http://open.weibo.com/wiki/API%E6%96%87%E6%A1%A3_V2/en
Installation
Download http://code.google.com/p/sinatopenapi/source/browse/trunk/SinaOpenApi.ph...
Save as SinaOpenApi.php and put into weibo_post module folder.
Project Page: http://drupal.org/sandbox/xenyo/1447074
Git Clone: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/xenyo/1447074.git weibo_autopost
Drupal Version: 7
Reviews of other projects:
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | drupalcs-result.txt | 2.92 KB | klausi |
| #1 | weibo_autopost_style_issues.txt | 16.25 KB | maxtorete |
Comments
Comment #1
maxtorete commentedSome initial comments with a superficial review:
You should change the URI on the first post to the public URI: git clone http://git.drupal.org/sandbox/xenyo/1447074.git weibo_autopost
Manual review
You must delete all variables set by your module on hook_uninstall.
You are using 'und' variables, that are used only if the language is undetermined, you can use the function I post below instead to get the values of current language:
$weibo_body = field_get_items('node', $form_state, 'summary');Automate review
You can find an automate code review from Drupal Code Sniffer here. I paste here the resume and attach the errors log.
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
Greets!
Comment #2
maxtorete commentedUmmmmm, I think that field_get_items would not be used on a form context, so maybe you must look for other solution there.
Comment #2.0
xenyo commentedchange git link
Comment #3
xenyo commentedmodule recommited, please review again .
Comment #4
xenyo commentedUnassign.
Comment #5
xenyo commentedIt may be a bit hard for you guys to review as Weibo is Chinese only and an account is needed. Anything we can do to make review easier?
Comment #6
patrickd commentedWe had those cases several time, a good solution would be to provide us the access data for a testaccount, if possible.
Comment #7
xenyo commentedThanks Patrick,
Made a test site and installed the module at here . (AUTO-LOGIN LINK)
You can add an article and THE SUMMARY of the post will be posted on a Weibo profile page we have set up at http://weibo.com/2615329401/profile. The module is set to post the title, summary and image with link back to the post. The summary is used as often the post needs to be tweaked to make it viable for the 140character limit.
Important Note: You need to log into Weibo to see profile, can use the test acct: wingkai738@yahoo.com.hk / yoshiki003 .
Feel free to ask if there are anything that needs explaining.
Comment #8
rogical commentedI think you can have a talk with this module SinaWeibo, both use weibo.com service.
Comment #9
xenyo commentedHi and thx for comment.
I am aware of Sinaweibo and have used it on the same sites as this module. They do 2 separate things. SinaWeibo is a log-in/sign-in module with Weibo Account and this module is a module to enable a site to Autopost selected Content Types to their Weibo Profile page.
Imagine Facebook, SinaWeibo is a Connectwith Facebook Module, and this module is a Module that posts to your company's Page whenever you update your Company Blog.
Another reason why we did not ask to add this feature to the SinaWeibo module, apart from it being 2 different things is that, SinaWeibo uses the previous Weibo API and we wanted to use the new version.
Hope the above, clarifies the differences.
Comment #10
xenyo commentedWas there any more comments or anything else that is required from us to make review easier?
Thanks
Comment #11
rogical commentedYes, check the Review bonus to speed your review.
Comment #12
xenyo commentedComment #13
xenyo commentedWill get started on Review Bonus when I finish my current workload. Thx Rogical.
Comment #14
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
manual review:
Comment #15
lildragon commentedHi,
Is this module supported in Drupal 6? thanks.
Comment #16
xenyo commentedHi,
Its just D7 at the moment and actually still sandbox as we have been really busy lately. I'll try to get this updated as soon as we can.
Regards,
Matt
Comment #16.0
xenyo commentedchange git clone
Comment #16.1
xenyo commentedupdate 3rd party link
Comment #16.2
xenyo commentedAdded reviews of other projects
Comment #17
xenyo commentedChanged updated and commited.
PAREVIEW: http://ventral.org/pareview/httpgitdrupalorgsandboxxenyo1447074git
In reply to Klausi's manual review (comment 14)
SinaOpenApi.php removed.
Edited but i am not sure if that is what was meant.
Removed
image markup is replaced by theme function.
data from 3rd party are filtered by check_plain().
Thanks for the review and i hope everything is covered.
Comment #17.0
xenyo commentedadd project review
Comment #18
xenyo commentedAdded tag: PAReviews: review bonus as outlined on http://drupal.org/node/1410826
Comment #19
rogical commented" so we need you to review other project applications .."
Comment #20
donatasp commented@xenyo: two reviews you've made are just links to ventral.org, and one is request for better issue description although information you ask is given in first comment. in general, manual in-depth reviews are expected of you.
Comment #21
donatasp commentedComment #22
donatasp commentedManual review
It is confusing that you named your module weibo_autopost, but
file names and module prefix is weibo_post. I'm not sure whether
you're required to fix this for approval but I think you should.
should:
under "Style" here http://drupal.org/node/447604.
requirements:
submit handler.
keyword.
there is no need to use global $_upload_params. Node form keys are
assigned to $node object as fields and are available for you in
hook_node_insert() and hook_node_update().
weibo_post_node_insert() and weibo_post_node_update() differs in one
line only. You should refactor this into separate general function.
Check
if (empty($language)) {in weibo_post_submit()always succeeds. There is no $language defined.
You are checking for field_image and field_logo. This is not user
friendly and makes assumptions that won't hold for a majority of node
types in real world. You should make image field configurable.
Also, there will be no need for ugly and wrong access of
$form['field'][$language][0]['#file'] once you move this code to
hook_node_insert(), hook_node_update() and use field_get_items() as
Maxorete suggested.
Comment #23
xenyo commentedThanks Donatasp,
Following your comments, we made pretty major updates/corrections to the module. Our reply to your comments as below;
Global variables no longer used.
Noted, Module now using node_presave
Noted, now using field api
Added function for admin to choose image field for post
Noted, now using field api
Additionally, added dependency of SinaWeibo Module.
Thanks again for your time to review.
Comment #24
xenyo commentedAlso made D6 version (client request). Put it in Sandbox in case anyone wants to use.
Comment #25
klausiRemoving review bonus tag, you have not done any manual review, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects.
Also, when finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).
Comment #26
xenyo commentedNoted and please find manual review of a project;
http://drupal.org/node/1447164#comment-6176252
Will try to find time to do more.
Added tag: PAReviews: review bonus as outlined on http://drupal.org/node/1410826
Comment #26.0
xenyo commentedadd review
Comment #27
xenyo commentedAdded another Review:
http://drupal.org/node/1556740#comment-6176436
Comment #27.0
xenyo commentedAdded review
Comment #28
klausiThanks for your reviews. when finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).
manual review:
Although you should definitively fix those issues, they are no blockers so I think this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #29
xenyo commentedCommitted with fixes as suggested.
Thanks Klausi and other commenters, really appreciate your time and patience. The process has actually been quite fun and educational.
Comment #30
patrickd commentedThanks for your contribution and welcome to the community of project contributors on drupal.org!
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #31.0
(not verified) commentedadded review - http://drupal.org/node/1556740#comment-6176436