興味深い課題があり、それを解決する方法がわかりません。mailchimp から購読者のリストを取得し、Web サイトのメンバー ページにそのデータを入力しています。サインアップのフィールドの 1 つに、「Web サイトまたは LinkedIn プロファイルの URL」と書かれています。
私がやりたいことは、彼らがリンクされたアドレスを提供したかどうかを確認し、そうであればリンクされたメンバープラグインにURLをドロップし、そうでない場合は他のデータを使用してより簡単なプロファイルを作成し、ウェブサイトに名前を付け、見出しなど.
私の問題は、jade 内で data.websiteField.match(/linkedin/) かどうかわからないため、問題が発生しているクライアント側の JavaScript にデータを渡すか、何か他のことを行う必要があることです。
mailchimp から返されるデータのサンプルを次に示します。
[ // this first bit is just the fields
[
"email address",
"first name",
"last name",
"role",
"organization",
"headline",
"website",
"areas of interest",
"please email me about:",
"member_rating",
"optin_time",
"optin_ip",
"confirm_time",
"confirm_ip",
"latitude",
"longitude",
"gmtoff",
"dstoff",
"timezone",
"cc",
"region",
"last_changed"
],
[ // and here's the first user
"woop@booomshakala.com", // haha, just hiding some data
"Woop",
"Shak",
"Tester",
"ShakaCo",
"Whooooooper",
"http://linkedin.com/in/costamichailidis", // hit me up sometime
"Creativity, Innovation, Ideas and Science",
"Job Placement, Internships, Recruitment & Retention, Technology & MOOCs, Measurement & Evaluation, Documentation & Dissemination",
2,
"2013-03-28 19:28:55",
"173.52.122.111",
"2013-03-28 19:29:12",
"173.52.122.111",
"40.7648000",
"-73.7775000",
"-5",
"-4",
"America/New_York", "US", "NY", "2013-03-28 19:29:12"
]
]
どんな助けでも揺れるでしょう!
また、エクスプレスを使用しています。Express はローカルをクライアント側の JavaScript で利用できるようにしますか?