In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how the integration of WordPress,SAP Kyma and Wechat is. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Let's continue to learn how to use SAP Kyma in practice.
What? Do you still need to develop PHP in SAP China Research Institute?
And how to publish some events on this locally built WordPress instance to SAP Kyma:
How do third-party applications register services on SAP Kyma
This article continues the introduction of this integration scenario and completes the final step: writing a Lambda function on SAP Kyma to respond to events sent from WordPress to Kyma. In response to the logic of the function, for demonstration purposes, Jerry simply chose to call Wechat API on Kyma and forward the blog content published on WordPress directly to some hard-coded Wechat user, that is, Jerry's own Wechat.
After following the steps in the previous two articles, we can see the services imported from the local WordPress (including exposed events and API) under the SAP Kyma service catalog (Service Catalog). You can simply compare this service directory to the Service Market Place of the SAP cloud platform.
Next, extension developers on SAP Kyma can start working on this service.
Click Add once to create a new WordPress service instance:
Then create a new Lambda function:
Select nodejs for the implementation type of Lambda function
The trigger method is event trigger- event trigger, and the specific trigger event is the post.published imported from WordPress, that is, the article publishing event.
In other words, when a new blog is published in WordPress, WordPress will trigger the post.published event, and the enhanced WordPress plug-in will pass this event along with the published blog content as a parameter to Kyma, while Kyma will call the Lambda function created above to listen on the post.published event, which is actually the observer in the observer-publisher design pattern.
The next development in the Lambda function is pure nodejs programming work. Using the axios library provided by nodejs, the blog content passed by WordPress to Kyma is parsed from the event parameter event, and the Wechat API is called to send to the specified Wechat users.
The role of the Dependencies region is equivalent to the package.json of the nodejs project, defining the various external dependencies required for the execution of nodejs code.
The final step is to create a Service Binding that binds the Lambda function to the WordPress service instance you created earlier.
This operation is consistent with the service configuration practice in the SAP cloud platform CloudFoundry environment, so programmers with SAP Cloud Platform development experience can easily get started with these configurations on SAP Kyma.
At this point, all the development and configuration work is over.
Finally, let's do a test. Jerry recently watched the mini-series Chernobyl, written by Craig Mazin and directed by Johan Renck and co-produced by HBO/Sky, and deeply felt the smallness and powerlessness of human beings in the wake of the nuclear crisis.
Post a blog post on WordPress:
What is the price of lies?
It's not that we mistake a lie for the truth.
What's really dangerous is
When we hear too many lies, we can't tell the truth.
Step through debugging WordPress and find that the content of the publishing blog is sent to the url pointing to the Kyma event handling:
Go back to Kyma's Lambda interface and click Show Logs to view the log. You can find that the event published by WordPress has been successfully received by Kyma's Lambda function:
On how the integration of WordPress,SAP Kyma and Wechat is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.