Meteor JS - How to access posts programmatically in Telescope app

半城伤御伤魂 提交于 2019-12-12 04:45:53

问题


I have recently started using Telescope (http://www.telesc.pe/) from the creators of Meteor for a small project. I am just starting to learn about Meteor, and since essentially database / web server and application stack are collapsed into one framework, I'm wondering what the most efficient way is for me to have an external application (for ex: python script) post and access posts/comments from Telescope. Essentially, I'd like a bot to be able to:

  • Create posts
  • Add comments to posts
  • Pull back a list of posts

Ideally I'd like to access this via HTTP requests (get/post/etc), but am not sure how to do this within telescope / meteor or possibly DB queries. Any help (such as an example API call to create a new post) or the appropriate way to do this using Meteor would be much appreciated!


回答1:


From the documentation it doesn't look like Telescope has a webservice API and there aren't any plans for it on the roadmap either.

Luckily meteor has a packaging system, which telescope already uses a lot. So you could make a meteor package that hooks into telescope and exposes webservices for the functionality you described.

Meteorpedia has a good article on how to create rest api's in meteor: here




回答2:


Telescope has a basic API. You can see a sample response here... http://meta.telesc.pe/api

And here's the package that makes that happen.
https://github.com/TelescopeJS/Telescope/tree/master/packages/telescope-api

You could copy and extend that package to accomplish whatever you need.



来源:https://stackoverflow.com/questions/25430468/meteor-js-how-to-access-posts-programmatically-in-telescope-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!